[PATCH v3 07/10] watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue Aug 3 08:48:50 CEST 2021


On 02/08/2021 21.20, Simon Glass wrote:
> Hi Rasmus,
> 
>> But let me one last time repeat why I think the post_probe approach is
>> the cleanest and a natural fit for DM: post_probe is (AIUI) a place
>> where a uclass can do some action it wants done for every device
>> belonging to that uclass. When CONFIG_WATCHDOG_AUTOSTART is set,
>> wdt_uclass does have such an action. When it's not set, the post_probe
>> method is a no-op.
> 
> I can certainly see you point. It definitely looks very natural for DM.
> 
> But I still think the problem of a device possibly resetting the board
> when probed (despite the various watchdog-reset things sprinkled
> throughout the code)

But that is the _very point_ of having the developer be able to opt in
[1] to starting the watchdog device ASAP (i.e. as soon as U-Boot is
capable of handling it). If some part of the boot process hangs or
U-Boot goes into an inf-loop without hitting a WATCHDOG_RESET in there,
one wants (or may want) the board to reset and hopefully follow some
other path the next time around. If the developer/project doesn't want
or need that, WATCHDOG_AUTOSTART can be disabled. And if the developer
wants to make use of this, it makes sense to have the watchdog device
monitor as much of the boot process as possible.

[1] ok, for historical reasons it's default-y, so actually an opt-out
knob, but the developer does have a choice regardless.

Rasmus


More information about the U-Boot mailing list