Re: [PATCH v6] watchdog: Add ARM TWD (MPCore private) watchdog driver
From: Fil Dunsky
Date: Sat Nov 21 2026 - 05:30:23 EST
On Fri, Nov 20, 2026 at 08:35:52PM -0800, Guenter Roeck wrote:
> One possibility might be to try cpufreq
> functions (cpufreq_get / cpufreq_register_notifier) as fallback.
Thanks, I implemented this for v7. Since the CPU and PERIPHCLK rates
need not be equal, the fallback first measures the watchdog counter
against monotonic time on CPU0, then uses cpufreq transition notifications
to scale that fixed calibration reference. Calibration only reads an
already enabled counter; an inactive counter is temporarily used in timer
mode, with its original registers restored afterwards.
The fallback assumes the PERIPHCLK/CPU ratio stays constant. Platforms
with an independently changing divider still need a clock provider.
Actual clock provider errors, including deferred probe, are preserved;
the fallback is used only when no clock is supplied. It requires CPU_FREQ
and an available CPU0 policy, deferring probe while the policy is absent.
Frequency changes reload the counter against the existing deadline, and
the maximum timeout is bounded at the maximum hardware CPU frequency.
> A MAINTAINERS entry would be preferred, but is not mandatory.
Kept the separate entry.
> I think we can call that on purpose. Maybe add a comment along that line
> into the code to clarify that.
Added the comment and corrected the commit/cover description: the device
PM callbacks retain the deadline, while the watchdog core's explicit
keepalives before suspend and after resume refresh it normally.
Full ARM GCC and Clang builds, module/modpost checks, and a GCC built-in
build with CPU_FREQ=n pass, along with the host regressions. I also
retested the exact v7 driver on Almond+ with PROVE_LOCKING: takeover,
CPU1 ioctls, timeout reduction, keepalives followed by expiration/reset,
and restart from CPU1 all passed. Those hardware runs use the DT-supplied
clock; the clock-less fallback and DVFS are covered by model tests only.
Sending v7 separately.
Thanks,
Fil