Skip to content

Commit cefc8be

Browse files
Kirill KorotaevLinus Torvalds
authored andcommitted
[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: Alexey Dobriyan <adobriyan@openvz.org> Acked-by: Martin 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c530cba commit cefc8be

8 files changed

Lines changed: 5 additions & 135 deletions

File tree

‎arch/i386/mm/fault.c‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
5959
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
6060
}
6161

62-
/*
63-
* Unlock any spinlocks which will prevent us from getting the
64-
* message out
65-
*/
66-
void bust_spinlocks(int yes)
67-
{
68-
int loglevel_save = console_loglevel;
69-
70-
if (yes) {
71-
oops_in_progress = 1;
72-
return;
73-
}
74-
#ifdef CONFIG_VT
75-
unblank_screen();
76-
#endif
77-
oops_in_progress = 0;
78-
/*
79-
* OK, the message is on the console. Now we call printk()
80-
* without oops_in_progress set so that printk will give klogd
81-
* a poke. Hold onto your hats...
82-
*/
83-
console_loglevel = 15; /* NMI oopser may have shut the console up */
84-
printk(" ");
85-
console_loglevel = loglevel_save;
86-
}
87-
8862
/*
8963
* Return EIP plus the CS segment base. The segment limit is also
9064
* adjusted, clamped to the kernel/user address space (whichever is

‎arch/ia64/kernel/traps.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include <asm/uaccess.h>
2525
#include <asm/kdebug.h>
2626

27-
extern spinlock_t timerlist_lock;
28-
2927
fpswa_interface_t *fpswa_interface;
3028
EXPORT_SYMBOL(fpswa_interface);
3129

@@ -53,34 +51,6 @@ trap_init (void)
5351
fpswa_interface = __va(ia64_boot_param->fpswa);
5452
}
5553

56-
/*
57-
* Unlock any spinlocks which will prevent us from getting the message out (timerlist_lock
58-
* is acquired through the console unblank code)
59-
*/
60-
void
61-
bust_spinlocks (int yes)
62-
{
63-
int loglevel_save = console_loglevel;
64-
65-
if (yes) {
66-
oops_in_progress = 1;
67-
return;
68-
}
69-
70-
#ifdef CONFIG_VT
71-
unblank_screen();
72-
#endif
73-
oops_in_progress = 0;
74-
/*
75-
* OK, the message is on the console. Now we call printk() without
76-
* oops_in_progress set so that printk will give klogd a poke. Hold onto
77-
* your hats...
78-
*/
79-
console_loglevel = 15; /* NMI oopser may have shut the console up */
80-
printk(" ");
81-
console_loglevel = loglevel_save;
82-
}
83-
8454
void
8555
die (const char *str, struct pt_regs *regs, long err)
8656
{

‎arch/m32r/mm/fault-nommu.c‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS];
4444
#define tlb_entry_d tlb_entry_d_dat[smp_processor_id()]
4545
#endif
4646

47-
/*
48-
* Unlock any spinlocks which will prevent us from getting the
49-
* message out
50-
*/
51-
void bust_spinlocks(int yes)
52-
{
53-
int loglevel_save = console_loglevel;
54-
55-
if (yes) {
56-
oops_in_progress = 1;
57-
return;
58-
}
59-
#ifdef CONFIG_VT
60-
unblank_screen();
61-
#endif
62-
oops_in_progress = 0;
63-
/*
64-
* OK, the message is on the console. Now we call printk()
65-
* without oops_in_progress set so that printk will give klogd
66-
* a poke. Hold onto your hats...
67-
*/
68-
console_loglevel = 15; /* NMI oopser may have shut the console up */
69-
printk(" ");
70-
console_loglevel = loglevel_save;
71-
}
72-
7347
void do_BUG(const char *file, int line)
7448
{
7549
bust_spinlocks(1);

‎arch/m32r/mm/fault.c‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,6 @@ unsigned int tlb_entry_d_dat[NR_CPUS];
4949

5050
extern void init_tlb(void);
5151

52-
/*
53-
* Unlock any spinlocks which will prevent us from getting the
54-
* message out
55-
*/
56-
void bust_spinlocks(int yes)
57-
{
58-
int loglevel_save = console_loglevel;
59-
60-
if (yes) {
61-
oops_in_progress = 1;
62-
return;
63-
}
64-
#ifdef CONFIG_VT
65-
unblank_screen();
66-
#endif
67-
oops_in_progress = 0;
68-
/*
69-
* OK, the message is on the console. Now we call printk()
70-
* without oops_in_progress set so that printk will give klogd
71-
* a poke. Hold onto your hats...
72-
*/
73-
console_loglevel = 15; /* NMI oopser may have shut the console up */
74-
printk(" ");
75-
console_loglevel = loglevel_save;
76-
}
77-
7852
/*======================================================================*
7953
* do_page_fault()
8054
*======================================================================*

‎arch/s390/mm/fault.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ static inline int notify_page_fault(enum die_val val, const char *str,
8383
}
8484
#endif
8585

86-
extern spinlock_t timerlist_lock;
8786

8887
/*
8988
* Unlock any spinlocks which will prevent us from getting the
90-
* message out (timerlist_lock is acquired through the
91-
* console unblank code)
89+
* message out.
9290
*/
9391
void bust_spinlocks(int yes)
9492
{

‎arch/x86_64/mm/fault.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,6 @@ static inline int notify_page_fault(enum die_val val, const char *str,
6969
return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
7070
}
7171

72-
void bust_spinlocks(int yes)
73-
{
74-
int loglevel_save = console_loglevel;
75-
if (yes) {
76-
oops_in_progress = 1;
77-
} else {
78-
#ifdef CONFIG_VT
79-
unblank_screen();
80-
#endif
81-
oops_in_progress = 0;
82-
/*
83-
* OK, the message is on the console. Now we call printk()
84-
* without oops_in_progress set so that printk will give klogd
85-
* a poke. Hold onto your hats...
86-
*/
87-
console_loglevel = 15; /* NMI oopser may have shut the console up */
88-
printk(" ");
89-
console_loglevel = loglevel_save;
90-
}
91-
}
92-
9372
/* Sometimes the CPU reports invalid exceptions on prefetch.
9473
Check that here and ignore.
9574
Opcode checker based on code by Richard Brunner */

‎lib/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
lib-y := ctype.o string.o vsprintf.o cmdline.o \
6-
bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
6+
rbtree.o radix-tree.o dump_stack.o \
77
idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \
88
sha1.o irq_regs.o reciprocal_div.o
99

@@ -12,7 +12,8 @@ lib-$(CONFIG_SMP) += cpumask.o
1212

1313
lib-y += kobject.o kref.o kobject_uevent.o klist.o
1414

15-
obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o
15+
obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o \
16+
bust_spinlocks.o
1617

1718
ifeq ($(CONFIG_DEBUG_KOBJECT),y)
1819
CFLAGS_kobject.o += -DDEBUG

‎lib/bust_spinlocks.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/vt_kern.h>
1515

1616

17-
void bust_spinlocks(int yes)
17+
void __attribute__((weak)) bust_spinlocks(int yes)
1818
{
1919
if (yes) {
2020
oops_in_progress = 1;

0 commit comments

Comments
 (0)