diff options
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 6e3c41a4024c..6e7b575ac33c 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -57,6 +57,8 @@ static int __init hardlockup_panic_setup(char *str) | |||
57 | { | 57 | { |
58 | if (!strncmp(str, "panic", 5)) | 58 | if (!strncmp(str, "panic", 5)) |
59 | hardlockup_panic = 1; | 59 | hardlockup_panic = 1; |
60 | else if (!strncmp(str, "0", 1)) | ||
61 | no_watchdog = 1; | ||
60 | return 1; | 62 | return 1; |
61 | } | 63 | } |
62 | __setup("nmi_watchdog=", hardlockup_panic_setup); | 64 | __setup("nmi_watchdog=", hardlockup_panic_setup); |
@@ -307,7 +309,7 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) | |||
307 | */ | 309 | */ |
308 | static int watchdog(void *unused) | 310 | static int watchdog(void *unused) |
309 | { | 311 | { |
310 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; | 312 | static struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; |
311 | struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer); | 313 | struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer); |
312 | 314 | ||
313 | sched_setscheduler(current, SCHED_FIFO, ¶m); | 315 | sched_setscheduler(current, SCHED_FIFO, ¶m); |
@@ -364,7 +366,8 @@ static int watchdog_nmi_enable(int cpu) | |||
364 | goto out_save; | 366 | goto out_save; |
365 | } | 367 | } |
366 | 368 | ||
367 | printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %p\n", cpu, event); | 369 | printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n", |
370 | cpu, PTR_ERR(event)); | ||
368 | return PTR_ERR(event); | 371 | return PTR_ERR(event); |
369 | 372 | ||
370 | /* success path */ | 373 | /* success path */ |
@@ -547,13 +550,13 @@ static struct notifier_block __cpuinitdata cpu_nfb = { | |||
547 | .notifier_call = cpu_callback | 550 | .notifier_call = cpu_callback |
548 | }; | 551 | }; |
549 | 552 | ||
550 | static int __init spawn_watchdog_task(void) | 553 | void __init lockup_detector_init(void) |
551 | { | 554 | { |
552 | void *cpu = (void *)(long)smp_processor_id(); | 555 | void *cpu = (void *)(long)smp_processor_id(); |
553 | int err; | 556 | int err; |
554 | 557 | ||
555 | if (no_watchdog) | 558 | if (no_watchdog) |
556 | return 0; | 559 | return; |
557 | 560 | ||
558 | err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); | 561 | err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); |
559 | WARN_ON(notifier_to_errno(err)); | 562 | WARN_ON(notifier_to_errno(err)); |
@@ -561,6 +564,5 @@ static int __init spawn_watchdog_task(void) | |||
561 | cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); | 564 | cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); |
562 | register_cpu_notifier(&cpu_nfb); | 565 | register_cpu_notifier(&cpu_nfb); |
563 | 566 | ||
564 | return 0; | 567 | return; |
565 | } | 568 | } |
566 | early_initcall(spawn_watchdog_task); | ||