wd_timer_period_ms = watchdog_thresh * 1000 * 2 / 5;
}
-void watchdog_nmi_reconfigure(bool run)
+void watchdog_nmi_stop(void)
{
int cpu;
cpus_read_lock();
- if (!run) {
- for_each_cpu(cpu, &wd_cpus_enabled)
- stop_wd_on_cpu(cpu);
- } else {
- watchdog_calc_timeouts();
- for_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask)
- start_wd_on_cpu(cpu);
- }
+ for_each_cpu(cpu, &wd_cpus_enabled)
+ stop_wd_on_cpu(cpu);
+ cpus_read_unlock();
+}
+
+void watchdog_nmi_start(void)
+{
+ int cpu;
+
+ cpus_read_lock();
+ watchdog_calc_timeouts();
+ for_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask)
+ start_wd_on_cpu(cpu);
cpus_read_unlock();
}
}
/**
- * watchdog_nmi_reconfigure - Optional function to reconfigure NMI watchdogs
- * @run: If false stop the watchdogs on all enabled CPUs
- * If true start the watchdogs on all enabled CPUs
+ * watchdog_nmi_stop - Stop the watchdog for reconfiguration
*
- * The core call order is:
- * watchdog_nmi_reconfigure(false);
+ * The reconfiguration steps are:
+ * watchdog_nmi_stop();
* update_variables();
- * watchdog_nmi_reconfigure(true);
+ * watchdog_nmi_start();
+ */
+void __weak watchdog_nmi_stop(void) { }
+
+/**
+ * watchdog_nmi_start - Start the watchdog after reconfiguration
*
- * The second call which starts the watchdogs again guarantees that the
- * following variables are stable across the call.
+ * Counterpart to watchdog_nmi_stop().
+ *
+ * The following variables have been updated in update_variables() and
+ * contain the currently valid configuration:
* - watchdog_enabled
* - watchdog_thresh
* - watchdog_cpumask
- *
- * After the call the variables can be changed again.
*/
-void __weak watchdog_nmi_reconfigure(bool run) { }
+void __weak watchdog_nmi_start(void) { }
/**
* lockup_detector_update_enable - Update the sysctl enable bit
static void softlockup_reconfigure_threads(void)
{
- watchdog_nmi_reconfigure(false);
+ watchdog_nmi_stop();
softlockup_park_all_threads();
set_sample_period();
lockup_detector_update_enable();
if (watchdog_enabled && watchdog_thresh)
softlockup_unpark_threads();
- watchdog_nmi_reconfigure(true);
+ watchdog_nmi_start();
}
/*
static inline void softlockup_init_threads(void) { }
static void softlockup_reconfigure_threads(void)
{
- watchdog_nmi_reconfigure(false);
+ watchdog_nmi_stop();
lockup_detector_update_enable();
- watchdog_nmi_reconfigure(true);
+ watchdog_nmi_start();
}
#endif /* !CONFIG_SOFTLOCKUP_DETECTOR */