watchdog: Respect watchdog cpumask on CPU hotplug

The rework of the watchdog core to use cpu_stop_work broke the watchdog
cpumask on CPU hotplug.

The watchdog_enable/disable() functions are now called unconditionally from
the hotplug callback, i.e. even on CPUs which are not in the watchdog
cpumask. As a consequence the watchdog can become unstoppable.

Only invoke them when the plugged CPU is in the watchdog cpumask.

Fixes: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work")
Reported-by: Maxime Coquelin <>
Signed-off-by: Thomas Gleixner <>
Tested-by: Maxime Coquelin <>
Cc: Peter Zijlstra <>
Cc: Oleg Nesterov <>
Cc: Michael Ellerman <>
Cc: Nicholas Piggin <>
Cc: Don Zickus <>
Cc: Ricardo Neri <>

1 file changed