]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] NMI watchdog Pentium M support
authorAdam Goode <adam@evdebs.org>
Thu, 15 Apr 2004 23:44:35 +0000 (16:44 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 15 Apr 2004 23:44:35 +0000 (16:44 -0700)
This adda nmi_watchdog=2 support to the Pentium M processor.  The P-M is
a P6 chip, but it shares some chipset logic with the Pentium 4, so it
requires this workaround to function.

Without this patch, NMI gets stuck after 1 count.  With it, the NMI
fires and breaks me out of UHCI-related hard lockups.

This patch is basically a modified version of the same patch for
oprofile. See the threaded discussion here:

http://lkml.org/lkml/2004/2/12/181

arch/i386/kernel/nmi.c

index e47887ba5f8d5e319f6bba248642240c6372e4f2..d74fb46abd3128061db8e01044cad7a8c705d183 100644 (file)
@@ -458,6 +458,13 @@ void nmi_watchdog_tick (struct pt_regs * regs)
                        wrmsr(MSR_P4_IQ_CCCR0, P4_NMI_IQ_CCCR0, 0);
                        apic_write(APIC_LVTPC, APIC_DM_NMI);
                }
+               else if (nmi_perfctr_msr == MSR_P6_PERFCTR0) {
+                       /* Only P6 based Pentium M need to re-unmask
+                        * the apic vector but it doesn't hurt
+                        * other P6 variant */
+                       apic_write(APIC_LVTPC,
+                                  apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
+               }
                wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1);
        }
 }