Skip to content

Commit

Permalink
i386: use the right wrapper to disable the NMI watchdog
Browse files Browse the repository at this point in the history
When disabled through /proc/sys/kernel/nmi_watchdog, the NMI watchdog uses the
stop() method directly, which does not decrement the activity counter, leading
to a BUG().  Use the wrapper function instead to fix that.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Björn Steinbrink authored and Linus Torvalds committed Jun 16, 2007
1 parent faa4cfa commit 54c6ed7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/i386/kernel/cpu/perfctr-watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct wd_ops {
void (*unreserve)(void);
int (*setup)(unsigned nmi_hz);
void (*rearm)(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz);
void (*stop)(void *);
void (*stop)(void);
unsigned perfctr;
unsigned evntsel;
u64 checkbit;
Expand Down Expand Up @@ -142,7 +142,7 @@ void disable_lapic_nmi_watchdog(void)
if (atomic_read(&nmi_active) <= 0)
return;

on_each_cpu(wd_ops->stop, NULL, 0, 1);
on_each_cpu(stop_apic_nmi_watchdog, NULL, 0, 1);
wd_ops->unreserve();

BUG_ON(atomic_read(&nmi_active) != 0);
Expand Down Expand Up @@ -255,7 +255,7 @@ static int setup_k7_watchdog(unsigned nmi_hz)
return 1;
}

static void single_msr_stop_watchdog(void *arg)
static void single_msr_stop_watchdog(void)
{
struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk);

Expand Down Expand Up @@ -442,7 +442,7 @@ static int setup_p4_watchdog(unsigned nmi_hz)
return 1;
}

static void stop_p4_watchdog(void *arg)
static void stop_p4_watchdog(void)
{
struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk);
wrmsr(wd->cccr_msr, 0, 0);
Expand Down Expand Up @@ -634,7 +634,7 @@ int lapic_watchdog_init(unsigned nmi_hz)
void lapic_watchdog_stop(void)
{
if (wd_ops)
wd_ops->stop(NULL);
wd_ops->stop();
}

unsigned lapic_adjust_nmi_hz(unsigned hz)
Expand Down

0 comments on commit 54c6ed7

Please sign in to comment.