Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Fil Dunsky <filipp.dunsky@gmail.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Russell King <linux@armlinux.org.uk>,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] watchdog: Add ARM TWD (MPCore private) watchdog driver
Date: Mon, 16 Nov 2026 06:05:08 -0800	[thread overview]
Message-ID: <fbf13b7f-e49d-4458-8a41-be965beab97d@roeck-us.net> (raw)
In-Reply-To: <179468235262.1897695.7261271002700550095@gmail.com>

On 11/14/26 10:52, Fil Dunsky wrote:
> 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

... but a single stalled CPU would trigger it. That overlaps with the per-CPU
watchdog timer. Maybe such stall detection is warranted; however, as I
mentioned above, it should be implemented as extension of kernel/watchdog.c.

> 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;

I'd suggest to simply not check for it in the first place to keep the
code simple. It isn't supposed to happen, it does not currently happen
as you point out above, and anyone starting it anyway will immediately
stop doing so.

> - keep following clock rate changes and set the watchdog up again on
>    resume;
> - keep the restart handler.
> 
Yes.

Thanks,
Guenter



      reply	other threads:[~2026-11-16 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 14:11 [PATCH v4] watchdog: Add ARM TWD (MPCore private) watchdog driver Fil Dunsky via B4 Relay
2026-11-14 15:56 ` Guenter Roeck
2026-11-14 18:52   ` Fil Dunsky
2026-11-16 14:05     ` Guenter Roeck [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=fbf13b7f-e49d-4458-8a41-be965beab97d@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=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=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