[RFC PATCH 1/5] watchdog: Add API to trigger reboots
maxime.ripard at free-electrons.com
Sun May 4 21:27:26 PDT 2014
On Fri, May 02, 2014 at 09:29:25PM -0700, Guenter Roeck wrote:
> > > + if (wdd->ops->reboot)
> > > + wdd_reboot_dev = wdd;
> > > +
> > Overall, it looks really great, but I guess we can make it a
> > list. Otherwise, we might end up in a situation where we could not
> > reboot anymore, like this one for example:
> > - a first watchdog is probed, registers a reboot function
> > - a second watchdog is probed, registers a reboot function that
> > overwrites the first one.
> > - then, the second watchdog disappears for some reason, and the
> > reboot is set to NULL
> I thought about that, but how likely (or unlikely) is that to ever happen ?
> So I figured it is not worth the effort, and would just add complexity without
> real gain. We could always add the list later if we ever encounter a situation
> where two watchdogs in the same system provide a reboot callback.
The A31 we were discussing about in the other thread that doesn't have
a watchdog driver yet has four, identical, watchogs. I'm not really
concerned about the mentionned issue, since they will never be
removed, but the situation might happen with an on-SoC watchdog and an
i2c one (if that even exists).
But yes, right, that can be postponed.
> > Or maybe we can just use the start callback, with the min timeout already
> > registered, and prevent the user to kick the watchdog.
> Doesn't always work, unfortunately, even now. The moxart driver causes
> an explicit and immediate reset. Also, some watchdogs don't reset the system
> directly but get an interrupt, which then calls the reset handler. Which,
> in our case, would call the start callback again, and you would have an endless
Ok. You have my Acked-by then.
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the linux-arm-kernel