aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/watchdog.c')
-rw-r--r--arch/powerpc/kernel/watchdog.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 2f6eadd9408d..c702a8981452 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -310,9 +310,6 @@ static int start_wd_on_cpu(unsigned int cpu)
310 if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED)) 310 if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED))
311 return 0; 311 return 0;
312 312
313 if (watchdog_suspended)
314 return 0;
315
316 if (!cpumask_test_cpu(cpu, &watchdog_cpumask)) 313 if (!cpumask_test_cpu(cpu, &watchdog_cpumask))
317 return 0; 314 return 0;
318 315
@@ -358,36 +355,39 @@ static void watchdog_calc_timeouts(void)
358 wd_timer_period_ms = watchdog_thresh * 1000 * 2 / 5; 355 wd_timer_period_ms = watchdog_thresh * 1000 * 2 / 5;
359} 356}
360 357
361void watchdog_nmi_reconfigure(void) 358void watchdog_nmi_stop(void)
362{ 359{
363 int cpu; 360 int cpu;
364 361
365 watchdog_calc_timeouts();
366
367 for_each_cpu(cpu, &wd_cpus_enabled) 362 for_each_cpu(cpu, &wd_cpus_enabled)
368 stop_wd_on_cpu(cpu); 363 stop_wd_on_cpu(cpu);
364}
369 365
366void watchdog_nmi_start(void)
367{
368 int cpu;
369
370 watchdog_calc_timeouts();
370 for_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask) 371 for_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask)
371 start_wd_on_cpu(cpu); 372 start_wd_on_cpu(cpu);
372} 373}
373 374
374/* 375/*
375 * This runs after lockup_detector_init() which sets up watchdog_cpumask. 376 * Invoked from core watchdog init.
376 */ 377 */
377static int __init powerpc_watchdog_init(void) 378int __init watchdog_nmi_probe(void)
378{ 379{
379 int err; 380 int err;
380 381
381 watchdog_calc_timeouts(); 382 err = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
382 383 "powerpc/watchdog:online",
383 err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powerpc/watchdog:online", 384 start_wd_on_cpu, stop_wd_on_cpu);
384 start_wd_on_cpu, stop_wd_on_cpu); 385 if (err < 0) {
385 if (err < 0)
386 pr_warn("Watchdog could not be initialized"); 386 pr_warn("Watchdog could not be initialized");
387 387 return err;
388 }
388 return 0; 389 return 0;
389} 390}
390arch_initcall(powerpc_watchdog_init);
391 391
392static void handle_backtrace_ipi(struct pt_regs *regs) 392static void handle_backtrace_ipi(struct pt_regs *regs)
393{ 393{