linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Using a watchdog as system reset
@ 2020-10-06 10:29 Uwe Kleine-König
  2020-10-06 11:56 ` Guenter Roeck
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Kleine-König @ 2020-10-06 10:29 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Frank Rowand
  Cc: linux-watchdog, devicetree, kernel

[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]

Hello,

I have an i.MX25 system here with an external watchdog (using the
gpio_wdt driver). So the internal watchdog (imx2_wdt) is unused.

The problem with the unused imx2_wdt is that this usually provides the
restart handler and now a reboot ends with

	reboot: Restarting system
	Reboot failed -- System halted

until eventually the watchdog bites and resets the machine.

I imagine that this is a common enough issue to warrant a generic
solution. My suggestion is to formalize and implement something like:

	watchdog {
		compatible = "linux,wdt-gpio";
		...
		provide-system-reset;
	}

with the sematic of: "This is the dedicated mechanism to reset this
machine."

(OK, I could enable the imx2_wdt driver and make sure with some udev
magic that the gpio watchdog is the one being fed by userspace. But
having two watchdogs fills me with some trepidation.)

Having said that, I wonder what the typical restart callback does
different from setting the timeout to a minimal value, start it and then
maybe call delay() to not return until the watchdog triggers. At least
that's what I would do for a watchdog that doesn't provide an explicit
.restart handler but has the provide-system-reset property.

In my eyes this is somewhat of a hardware property, but I can imagine
that others don't agree and argue this shouldn't go into the device
tree. @Rob: What is your position here?

Does this sound sane? Do we also need a property like
"no-provide-system-reset" to better maintain backward compatibility?
(which then would result in not registering the watchdog as reset
trigger even if the driver provides a .restart.)
Does someone know a better name for the property?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-10-07 11:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 10:29 [RFC] Using a watchdog as system reset Uwe Kleine-König
2020-10-06 11:56 ` Guenter Roeck
2020-10-06 14:29   ` Guenter Roeck
2020-10-06 18:41     ` Uwe Kleine-König
2020-10-06 21:04       ` Guenter Roeck
2020-10-07  7:12         ` Uwe Kleine-König
2020-10-07  7:25           ` Ahmad Fatoum
2020-10-07  7:32             ` Ahmad Fatoum
2020-10-07 10:18             ` dt-binding to define default watchdog and machine reset (Was: Re: [RFC] Using a watchdog as system reset) Uwe Kleine-König
2020-10-07 11:04               ` Guenter Roeck
2020-10-07 11:35                 ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).