mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fil Dunsky <filipp.dunsky@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6] watchdog: Add ARM TWD (MPCore private) watchdog driver
Date: Sat, 21 Nov 2026 13:29:42 +0300	[thread overview]
Message-ID: <179525698278.4.12784611811620173233@gmail.com> (raw)
In-Reply-To: <377b89b7-90a3-41c9-88c4-fd3393055f91@roeck-us.net>

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


      reply	other threads:[~2026-11-21 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:59 Fil Dunsky via B4 Relay
2026-11-21  4:35 ` Guenter Roeck
2026-11-21 10:29   ` Fil Dunsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179525698278.4.12784611811620173233@gmail.com \
    --to=filipp.dunsky@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®