diff options
-rw-r--r-- | kernel/softlockup.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index e423b3a918fd..65839c54abf5 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/notifier.h> | 15 | #include <linux/notifier.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | 17 | ||
18 | #include <asm/irq_regs.h> | ||
19 | |||
18 | static DEFINE_SPINLOCK(print_lock); | 20 | static DEFINE_SPINLOCK(print_lock); |
19 | 21 | ||
20 | static DEFINE_PER_CPU(unsigned long, touch_timestamp); | 22 | static DEFINE_PER_CPU(unsigned long, touch_timestamp); |
@@ -72,6 +74,7 @@ void softlockup_tick(void) | |||
72 | int this_cpu = smp_processor_id(); | 74 | int this_cpu = smp_processor_id(); |
73 | unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu); | 75 | unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu); |
74 | unsigned long print_timestamp; | 76 | unsigned long print_timestamp; |
77 | struct pt_regs *regs = get_irq_regs(); | ||
75 | unsigned long now; | 78 | unsigned long now; |
76 | 79 | ||
77 | if (touch_timestamp == 0) { | 80 | if (touch_timestamp == 0) { |
@@ -101,15 +104,18 @@ void softlockup_tick(void) | |||
101 | wake_up_process(per_cpu(watchdog_task, this_cpu)); | 104 | wake_up_process(per_cpu(watchdog_task, this_cpu)); |
102 | 105 | ||
103 | /* Warn about unreasonable 10+ seconds delays: */ | 106 | /* Warn about unreasonable 10+ seconds delays: */ |
104 | if (now > (touch_timestamp + 10)) { | 107 | if (now <= (touch_timestamp + 10)) |
105 | per_cpu(print_timestamp, this_cpu) = touch_timestamp; | 108 | return; |
106 | 109 | ||
107 | spin_lock(&print_lock); | 110 | per_cpu(print_timestamp, this_cpu) = touch_timestamp; |
108 | printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n", | 111 | |
109 | this_cpu); | 112 | spin_lock(&print_lock); |
113 | printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n", this_cpu); | ||
114 | if (regs) | ||
115 | show_regs(regs); | ||
116 | else | ||
110 | dump_stack(); | 117 | dump_stack(); |
111 | spin_unlock(&print_lock); | 118 | spin_unlock(&print_lock); |
112 | } | ||
113 | } | 119 | } |
114 | 120 | ||
115 | /* | 121 | /* |