Re: [PATCH v3 07/11] watchdog: Add ARM TWD (MPCore private) watchdog driver
From: Fil Dunsky
Date: Tue Nov 03 2026 - 11:51:19 EST
Hi Guenter,
On Mon, Oct 19, 2026 at 06:46:41PM -0700, Guenter Roeck wrote:
> The issues raised by Sashiko will need to be addressed, or you'll need
> to explain why they are non-issues.
Thanks for having a look. All three are real and are fixed in the next
version:
1. cpus_read_lock() in the clock notifier (lock inversion with CPU
hotplug through cpufreq): the driver no longer takes cpus_read_lock()
anywhere. The armed state and the rate are published with
WRITE_ONCE() and applied with on_each_cpu(); a CPU coming online
meanwhile either sees the new values in its hotplug callback or is
reached by on_each_cpu().
2. armed set after on_each_cpu() in start, racing with a rate change:
the flag is now set first, and the start path and the clock notifier
each have a full barrier between their store and their load, so
either the watchdog is started with the new rate or the notifier sees
it armed and reloads it.
3. Watchdog state lost in a deep idle state: a CPU PM notifier sets the
watchdog of the CPU up again on CPU_PM_EXIT/CPU_PM_ENTER_FAILED when
the device is active and the watchdog mode bit is gone. It does not
reload a watchdog that kept running, so idle exits do not count as
pings.
The earlier Sashiko points (prescaler of a watchdog left running by the
boot loader, rate changes, resume) were handled in v2 and v3.
As the driver is not specific to the Cortina SoC, the next version will
be a standalone patch to you and Wim instead of part of the CS75xx
series. It will be sent after v7.4-rc1.
Fil