aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/nmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/nmi.c')
-rw-r--r--arch/sparc/kernel/nmi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
index b129611590a4..d242a7340541 100644
--- a/arch/sparc/kernel/nmi.c
+++ b/arch/sparc/kernel/nmi.c
@@ -47,7 +47,7 @@ static DEFINE_PER_CPU(short, wd_enabled);
47static int endflag __initdata; 47static int endflag __initdata;
48 48
49static DEFINE_PER_CPU(unsigned int, last_irq_sum); 49static DEFINE_PER_CPU(unsigned int, last_irq_sum);
50static DEFINE_PER_CPU(local_t, alert_counter); 50static DEFINE_PER_CPU(long, alert_counter);
51static DEFINE_PER_CPU(int, nmi_touch); 51static DEFINE_PER_CPU(int, nmi_touch);
52 52
53void touch_nmi_watchdog(void) 53void touch_nmi_watchdog(void)
@@ -96,7 +96,6 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
96 int cpu = smp_processor_id(); 96 int cpu = smp_processor_id();
97 97
98 clear_softint(1 << irq); 98 clear_softint(1 << irq);
99 pcr_ops->write(PCR_PIC_PRIV);
100 99
101 local_cpu_data().__nmi_count++; 100 local_cpu_data().__nmi_count++;
102 101
@@ -105,6 +104,8 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
105 if (notify_die(DIE_NMI, "nmi", regs, 0, 104 if (notify_die(DIE_NMI, "nmi", regs, 0,
106 pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) 105 pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
107 touched = 1; 106 touched = 1;
107 else
108 pcr_ops->write(PCR_PIC_PRIV);
108 109
109 sum = kstat_irqs_cpu(0, cpu); 110 sum = kstat_irqs_cpu(0, cpu);
110 if (__get_cpu_var(nmi_touch)) { 111 if (__get_cpu_var(nmi_touch)) {
@@ -112,13 +113,13 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
112 touched = 1; 113 touched = 1;
113 } 114 }
114 if (!touched && __get_cpu_var(last_irq_sum) == sum) { 115 if (!touched && __get_cpu_var(last_irq_sum) == sum) {
115 local_inc(&__get_cpu_var(alert_counter)); 116 __this_cpu_inc(per_cpu_var(alert_counter));
116 if (local_read(&__get_cpu_var(alert_counter)) == 30 * nmi_hz) 117 if (__this_cpu_read(per_cpu_var(alert_counter)) == 30 * nmi_hz)
117 die_nmi("BUG: NMI Watchdog detected LOCKUP", 118 die_nmi("BUG: NMI Watchdog detected LOCKUP",
118 regs, panic_on_timeout); 119 regs, panic_on_timeout);
119 } else { 120 } else {
120 __get_cpu_var(last_irq_sum) = sum; 121 __get_cpu_var(last_irq_sum) = sum;
121 local_set(&__get_cpu_var(alert_counter), 0); 122 __this_cpu_write(per_cpu_var(alert_counter), 0);
122 } 123 }
123 if (__get_cpu_var(wd_enabled)) { 124 if (__get_cpu_var(wd_enabled)) {
124 write_pic(picl_value(nmi_hz)); 125 write_pic(picl_value(nmi_hz));