mbox series

[v4,00/10] handling all DM watchdogs in watchdog_reset()

Message ID 20210802150016.588750-1-rasmus.villemoes@prevas.dk
Headers show
Series handling all DM watchdogs in watchdog_reset() | expand

Message

Rasmus Villemoes Aug. 2, 2021, 3 p.m. UTC
This series is an attempt at expanding the wdt-uclass provided
watchdog_reset() to handle all DM watchdogs, not just the first
one. Some of the ad hoc work done for the first DM watchdog in
initr_watchdog() is now moved to a .pre_probe hook so it is
automatically done for all devices.

It also includes a patch adding a driver for a gpio-petted watchdog
device (and a sandbox test of that) - it is included here because that
also gives a relatively easy way to have more than one (kind of)
watchdog device in the sandbox, which is then used at the end to test
that watchdog_reset() behaves as expected.

v2 here: https://lore.kernel.org/u-boot/20210527220017.1266765-1-rasmus.villemoes@prevas.dk/

v3 here: https://lore.kernel.org/u-boot/20210702124510.124401-1-rasmus.villemoes@prevas.dk/

Changes in v4:

- Do not make init_watchdog_dev() into a .post_probe hook, but call it
  from within the probing loop in initr_watchdog().

Rasmus Villemoes (10):
  watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now()
  watchdog: wdt-uclass.c: introduce struct wdt_priv
  watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition
  watchdog: wdt-uclass.c: refactor initr_watchdog()
  watchdog: wdt-uclass.c: keep track of each device's running state
  sandbox: disable CONFIG_WATCHDOG_AUTOSTART
  watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()
  watchdog: add gpio watchdog driver
  sandbox: add test of wdt_gpio driver
  sandbox: add test of wdt-uclass' watchdog_reset()

 arch/sandbox/dts/test.dts                     |   8 +
 configs/sandbox64_defconfig                   |   2 +
 configs/sandbox_defconfig                     |   2 +
 .../watchdog/gpio-wdt.txt                     |  19 ++
 drivers/watchdog/Kconfig                      |   9 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/gpio_wdt.c                   |  68 +++++++
 drivers/watchdog/wdt-uclass.c                 | 167 ++++++++++++------
 include/asm-generic/global_data.h             |   6 -
 test/dm/wdt.c                                 |  90 +++++++++-
 10 files changed, 314 insertions(+), 58 deletions(-)
 create mode 100644 doc/device-tree-bindings/watchdog/gpio-wdt.txt
 create mode 100644 drivers/watchdog/gpio_wdt.c

Comments

Rasmus Villemoes Aug. 11, 2021, 6:05 a.m. UTC | #1
Ping. Stefan, any chance you could pick up this series? Simon has nodded
to the v4 version of patch 7, so now they all have at least one R-b tag.

Rasmus
Stefan Roese Aug. 11, 2021, 6:10 a.m. UTC | #2
Hi Rasmus,

On 11.08.21 08:05, Rasmus Villemoes wrote:
> Ping. Stefan, any chance you could pick up this series? Simon has nodded
> to the v4 version of patch 7, so now they all have at least one R-b tag.

Actually I'm waiting on a reply from you here. As I already tried to
integrate all patches in v4 and found some errors while running the
CI tests (my original reply here [1]). Here my message again:

"
After applying the patchset v4 to current master, I see this error when
building for "x530":

board/alliedtelesis/x530/x530.c: In function 'arch_preboot_os':
board/alliedtelesis/x530/x530.c:125:13: error: 'gd_t' {aka 'volatile
struct global_data'} has no member named 'watchdog_dev'
    125 |  wdt_stop(gd->watchdog_dev);
        |             ^~
make[1]: *** [scripts/Makefile.build:254:
board/alliedtelesis/x530/x530.o] Error 1

Perhaps we need a common function now to stop all watchdogs, which can
be called from such places?
"

Thanks,
Stefan

[1] https://yhbt.net/lore/all/e2e70a72-7aa0-79d4-7a4c-d542ed290f1e@denx.de/
Rasmus Villemoes Aug. 11, 2021, 6:19 a.m. UTC | #3
On 11/08/2021 08.10, Stefan Roese wrote:
> Hi Rasmus,
> 
> On 11.08.21 08:05, Rasmus Villemoes wrote:
>> Ping. Stefan, any chance you could pick up this series? Simon has nodded
>> to the v4 version of patch 7, so now they all have at least one R-b tag.
> 
> Actually I'm waiting on a reply from you here.

Sorry about that! It turns out quite a few mails from you were hiding in
my junk mail folder (but nothing else sent to the U-Boot mailing list).
Most seem to have just been "R-b", but I'll have to go over them to see
what other important things I've missed.

Rasmus