Re: [PATCH v4] watchdog: Add ARM TWD (MPCore private) watchdog driver

From: Fil Dunsky

Date: Sat Nov 14 2026 - 13:52:53 EST


Hi Guenter,

On Sat, Nov 14, 2026 at 07:56:12AM -0800, Guenter Roeck wrote:
> Watchdog drivers are supposed to watch the system as a whole, not on a
> per-CPU level. This patch goes way beyond the scope of a system watchdog
> driver. Per-CPU watchdogs are handled in kernel/watchdog.c. I do not think
> it is a good idea to overlay that with a second per-CPU watchdog mechanism.

Thanks, understood. Watching individual CPUs was not the intent: all the
watchdogs get the same timeout and are pinged together from the ioctl,
so the driver acts as one system watchdog. Going through every CPU only
follows from the registers being banked, and it is what made the driver
grow (hotplug state, CPU PM, the races Sashiko found).

The board needs one system watchdog and nothing per CPU: its boot loader
starts the watchdog of CPU0 only, and the SoC has no other watchdog.
Would a driver along these lines be acceptable?

- use the watchdog of CPU0 only: start, stop, ping and get_timeleft run
there through smp_call_function_single();
- no CPU hotplug state: on 32-bit ARM CPU0 cannot be taken offline
unless the platform allows it with cpu_can_disable(), and the driver
would not probe if CPU0 is hotpluggable;
- the watchdogs of the other CPUs are not used, one found running at
probe time is stopped;
- keep following clock rate changes and set the watchdog up again on
resume;
- keep the restart handler.

Fil