Commit cefc8be8 authored by Kirill Korotaev's avatar Kirill Korotaev Committed by Linus Torvalds

[PATCH] Consolidate bust_spinlocks()

Part of long forgotten patch
http://groups.google.com/group/fa.linux.kernel/msg/e98e941ce1cf29f6?dmode=source
Since then, m32r grabbed two copies.

Leave s390 copy because of important absence of CONFIG_VT, but remove
references to non-existent timerlist_lock.  ia64 also loses timerlist_lock.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@openvz.org>
Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c530cba6
...@@ -59,32 +59,6 @@ static inline int notify_page_fault(enum die_val val, const char *str, ...@@ -59,32 +59,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
} }
/*
* Unlock any spinlocks which will prevent us from getting the
* message out
*/
void bust_spinlocks(int yes)
{
int loglevel_save = console_loglevel;
if (yes) {
oops_in_progress = 1;
return;
}
#ifdef CONFIG_VT
unblank_screen();
#endif
oops_in_progress = 0;
/*
* OK, the message is on the console. Now we call printk()
* without oops_in_progress set so that printk will give klogd
* a poke. Hold onto your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
}
/* /*
* Return EIP plus the CS segment base. The segment limit is also * Return EIP plus the CS segment base. The segment limit is also
* adjusted, clamped to the kernel/user address space (whichever is * adjusted, clamped to the kernel/user address space (whichever is
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/kdebug.h> #include <asm/kdebug.h>
extern spinlock_t timerlist_lock;
fpswa_interface_t *fpswa_interface; fpswa_interface_t *fpswa_interface;
EXPORT_SYMBOL(fpswa_interface); EXPORT_SYMBOL(fpswa_interface);
...@@ -53,34 +51,6 @@ trap_init (void) ...@@ -53,34 +51,6 @@ trap_init (void)
fpswa_interface = __va(ia64_boot_param->fpswa); fpswa_interface = __va(ia64_boot_param->fpswa);
} }
/*
* Unlock any spinlocks which will prevent us from getting the message out (timerlist_lock
* is acquired through the console unblank code)
*/
void
bust_spinlocks (int yes)
{
int loglevel_save = console_loglevel;
if (yes) {
oops_in_progress = 1;
return;
}
#ifdef CONFIG_VT
unblank_screen();
#endif
oops_in_progress = 0;
/*
* OK, the message is on the console. Now we call printk() without
* oops_in_progress set so that printk will give klogd a poke. Hold onto
* your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
}
void void
die (const char *str, struct pt_regs *regs, long err) die (const char *str, struct pt_regs *regs, long err)
{ {
......
...@@ -44,32 +44,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS]; ...@@ -44,32 +44,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS];
#define tlb_entry_d tlb_entry_d_dat[smp_processor_id()] #define tlb_entry_d tlb_entry_d_dat[smp_processor_id()]
#endif #endif
/*
* Unlock any spinlocks which will prevent us from getting the
* message out
*/
void bust_spinlocks(int yes)
{
int loglevel_save = console_loglevel;
if (yes) {
oops_in_progress = 1;
return;
}
#ifdef CONFIG_VT
unblank_screen();
#endif
oops_in_progress = 0;
/*
* OK, the message is on the console. Now we call printk()
* without oops_in_progress set so that printk will give klogd
* a poke. Hold onto your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
}
void do_BUG(const char *file, int line) void do_BUG(const char *file, int line)
{ {
bust_spinlocks(1); bust_spinlocks(1);
......
...@@ -49,32 +49,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS]; ...@@ -49,32 +49,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS];
extern void init_tlb(void); extern void init_tlb(void);
/*
* Unlock any spinlocks which will prevent us from getting the
* message out
*/
void bust_spinlocks(int yes)
{
int loglevel_save = console_loglevel;
if (yes) {
oops_in_progress = 1;
return;
}
#ifdef CONFIG_VT
unblank_screen();
#endif
oops_in_progress = 0;
/*
* OK, the message is on the console. Now we call printk()
* without oops_in_progress set so that printk will give klogd
* a poke. Hold onto your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
}
/*======================================================================* /*======================================================================*
* do_page_fault() * do_page_fault()
*======================================================================* *======================================================================*
......
...@@ -83,12 +83,10 @@ static inline int notify_page_fault(enum die_val val, const char *str, ...@@ -83,12 +83,10 @@ static inline int notify_page_fault(enum die_val val, const char *str,
} }
#endif #endif
extern spinlock_t timerlist_lock;
/* /*
* Unlock any spinlocks which will prevent us from getting the * Unlock any spinlocks which will prevent us from getting the
* message out (timerlist_lock is acquired through the * message out.
* console unblank code)
*/ */
void bust_spinlocks(int yes) void bust_spinlocks(int yes)
{ {
......
...@@ -69,27 +69,6 @@ static inline int notify_page_fault(enum die_val val, const char *str, ...@@ -69,27 +69,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
} }
void bust_spinlocks(int yes)
{
int loglevel_save = console_loglevel;
if (yes) {
oops_in_progress = 1;
} else {
#ifdef CONFIG_VT
unblank_screen();
#endif
oops_in_progress = 0;
/*
* OK, the message is on the console. Now we call printk()
* without oops_in_progress set so that printk will give klogd
* a poke. Hold onto your hats...
*/
console_loglevel = 15; /* NMI oopser may have shut the console up */
printk(" ");
console_loglevel = loglevel_save;
}
}
/* Sometimes the CPU reports invalid exceptions on prefetch. /* Sometimes the CPU reports invalid exceptions on prefetch.
Check that here and ignore. Check that here and ignore.
Opcode checker based on code by Richard Brunner */ Opcode checker based on code by Richard Brunner */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
lib-y := ctype.o string.o vsprintf.o cmdline.o \ lib-y := ctype.o string.o vsprintf.o cmdline.o \
bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \ rbtree.o radix-tree.o dump_stack.o \
idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \
sha1.o irq_regs.o reciprocal_div.o sha1.o irq_regs.o reciprocal_div.o
...@@ -12,7 +12,8 @@ lib-$(CONFIG_SMP) += cpumask.o ...@@ -12,7 +12,8 @@ lib-$(CONFIG_SMP) += cpumask.o
lib-y += kobject.o kref.o kobject_uevent.o klist.o lib-y += kobject.o kref.o kobject_uevent.o klist.o
obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o \
bust_spinlocks.o
ifeq ($(CONFIG_DEBUG_KOBJECT),y) ifeq ($(CONFIG_DEBUG_KOBJECT),y)
CFLAGS_kobject.o += -DDEBUG CFLAGS_kobject.o += -DDEBUG
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/vt_kern.h> #include <linux/vt_kern.h>
void bust_spinlocks(int yes) void __attribute__((weak)) bust_spinlocks(int yes)
{ {
if (yes) { if (yes) {
oops_in_progress = 1; oops_in_progress = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment