Skip to content

RFC Migrate watchdog reset to cyclic infrastructure

Stefan Roese u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8cmd/cyclic: Use div64 macros for division and remaindercmd/cyclic.c+4 -31 reply
2/8watchdog: Integrate watchdog triggering into the cyclic frameworkdrivers/watchdog/Kconfig drivers/watchdog/wdt-uclass.c+50 -322 replies
3/8cyclic: Introduce schedule() functioncommon/cyclic.c include/cyclic.h+16 -01 reply
4/8cyclic: Use schedule() instead of WATCHDOG_RESET()arch/arm/mach-at91/phy.c arch/arm/mach-imx/i2c-mxv7.c arch/arm/mach-socfpga/spl_a10.c +100 more+235 -2411 reply
5/8watchdog: Get rid of ASSEMBLY hacksarch/powerpc/lib/ticks.S include/watchdog.h+19 -362 replies
6/8watchdog: Remove WATCHDOG_RESET macroinclude/watchdog.h+0 -361 reply
7/8watchdog: Further cleanupinclude/watchdog.h+2 -41 reply
8/8WIP: .azure-pipelines.yml: Remove evb-ast2600.azure-pipelines.yml+0 -34 replies

Reviews trailers per patch

5 of 8 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/8R-b
2/8
3/8R-b
4/8R-b
5/8
6/8R-b
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/8] Migrate watchdog reset to cyclic infrastructure

This patchset migrates the watchdog triggering (WATCHDOG_RESET calls) to the newly introduced cyclic execution framework. For this, the watchdog driver now registers a cyclic execution function for each WDT device that needs to get serviced. Additionally the cyclic IF is a bit extended to also support the CONFIG_HW_WATCHDOG users. It might make sense to deprecate this HW_WATCHDOG usage at some point.

Please note that this migration work is based on the cyclic execution infrastructure, which I posted in the last few weeks. So these cyclic patches need to be applied for this migration to work.

Please also note that I'm currently seeing Azure CI build issues with the "test.ph evb_ast2600" build target, which runs into a timeout. I've temporarily removed this target from the Azure CI builds, so that the world build can continue to run. Hopefully I will get some hints / assistance to fix this specific issue.

Some further cleanup and improvements are possible after this patch. E.g. Heinrich mentioned that the WATCHDOG_RESET call locations need to get improved / changed in some places.

I've pushed a working branch here for anyone who wants to do some testing with this patchset:

https://source.denx.de/u-boot/custodians/u-boot-watchdog/-/commits/watchdog-migration-to-cyclic-v1-2022-08-29

Here the log from octeon_ebb7304 compiled on this branch:

U-Boot 2022.10-rc3-00063-g1050cb3e6d8e (Aug 29 2022 - 07:57:07 +0200)

SoC:   Octeon CN73xx (16 cores)
Model: cavium,ebb7304
DRAM:  256 MiB (16 GiB total)
Core:  31 devices, 24 uclasses, devicetree: separate
WDT:   Started interrupt-controller@1010000000000 with servicing all 1000ms (60s timeout)
Flash: 8 MiB
MMC:   octeontx-mmc0: 0, octeontx-mmc1: 1
Loading Environment from Flash... OK
QLM 0: PCIe gen3 root complex, x4 lanes
QLM 2: SGMII
QLM 3: XLAUI
QLM 5: SGMII
Net:   eth0: ethernet-mac-nexus@11800e0000000

=> cyclic list
function: interrupt-controller@1010000000000, cpu-time: 4 us, frequency: 1.11 times/s => wdt list
interrupt-controller@1010000000000 (wdt_octeontx)

Any comments and suggestions are welcome.

Thanks,
Stefan

Stefan Roese (8):
cmd/cyclic: Use div64 macros for division and remainder
watchdog: Integrate watchdog triggering into the cyclic framework
cyclic: Introduce schedule() function
cyclic: Use schedule() instead of WATCHDOG_RESET()
watchdog: Get rid of ASSEMBLY hacks
watchdog: Remove WATCHDOG_RESET macro
watchdog: Further cleanup
WIP: .azure-pipelines.yml: Remove evb-ast2600

 .azure-pipelines.yml                          |  3 -
 arch/arm/mach-at91/phy.c                      |  2 +-
 arch/arm/mach-imx/i2c-mxv7.c                  |  2 +-
 arch/arm/mach-socfpga/spl_a10.c               |  8 +-
 .../cmd_stm32prog/stm32prog_serial.c          |  6 +-
 arch/m68k/lib/time.c                          |  2 +-
 arch/powerpc/cpu/mpc8xx/cpu_init.c            |  2 +-
 arch/powerpc/lib/bootm.c                      |  6 +-
 arch/powerpc/lib/cache.c                      |  2 +-
 arch/powerpc/lib/interrupts.c                 |  2 +-
 arch/powerpc/lib/ticks.S                      |  5 +-
 board/astro/mcf5373l/fpga.c                   |  4 +-
 board/dhelectronics/dh_stm32mp1/board.c       |  2 +-
 board/liebherr/display5/spl.c                 |  2 +-
 board/nokia/rx51/rx51.c                       |  2 +-
 board/st/stm32mp1/stm32mp1.c                  |  2 +-
 boot/bootretry.c                              |  2 +-
 boot/image-board.c                            |  2 +-
 cmd/cyclic.c                                  |  7 +-
 cmd/fastboot.c                                |  2 +-
 cmd/mem.c                                     | 16 ++--
 cmd/usb_mass_storage.c                        |  2 +-
 cmd/ximg.c                                    |  2 +-
 common/board_f.c                              |  4 +-
 common/board_r.c                              |  2 +-
 common/cli_readline.c                         |  4 +-
 common/console.c                              |  2 +-
 common/cyclic.c                               | 11 +++
 common/dfu.c                                  |  2 +-
 common/lcd.c                                  | 10 +--
 common/menu.c                                 |  6 +-
 common/usb_kbd.c                              |  2 +-
 common/xyzModem.c                             |  2 +-
 drivers/block/ide.c                           |  8 +-
 drivers/crypto/aspeed/aspeed_hace.c           |  2 +-
 drivers/crypto/hash/hash_sw.c                 |  2 +-
 drivers/ddr/altera/sdram_arria10.c            |  4 +-
 drivers/ddr/altera/sdram_n5x.c                |  4 +-
 drivers/ddr/altera/sdram_soc64.c              |  2 +-
 drivers/fpga/intel_sdm_mb.c                   |  8 +-
 drivers/fpga/socfpga_arria10.c                |  8 +-
 drivers/i2c/mxc_i2c.c                         |  4 +-
 drivers/mmc/octeontx_hsmmc.c                  | 12 +--
 drivers/mmc/sh_mmcif.c                        |  6 +-
 drivers/mmc/stm32_sdmmc2.c                    |  2 +-
 drivers/mtd/cfi_flash.c                       |  4 +-
 drivers/mtd/nand/core.c                       |  2 +-
 drivers/mtd/nand/raw/atmel_nand.c             |  6 +-
 drivers/mtd/nand/raw/nand_base.c              | 10 +--
 drivers/mtd/nand/raw/nand_util.c              |  6 +-
 drivers/mtd/nand/spi/core.c                   |  4 +-
 drivers/mtd/onenand/onenand_base.c            |  4 +-
 drivers/mtd/spi/spi-nor-core.c                |  4 +-
 drivers/net/octeontx2/nix.c                   |  2 +-
 drivers/net/octeontx2/nix_af.c                | 32 ++++----
 drivers/ram/stm32mp1/stm32mp1_tests.c         |  2 +-
 drivers/serial/atmel_usart.c                  |  2 +-
 drivers/serial/ns16550.c                      |  6 +-
 drivers/serial/serial-uclass.c                |  2 +-
 drivers/serial/serial_bcm283x_mu.c            |  2 +-
 drivers/serial/serial_lpuart.c                |  8 +-
 drivers/serial/serial_mpc8xx.c                |  4 +-
 drivers/serial/serial_mt7620.c                |  2 +-
 drivers/serial/serial_mtk.c                   |  4 +-
 drivers/serial/serial_mxc.c                   |  6 +-
 drivers/serial/serial_octeon_bootcmd.c        |  2 +-
 drivers/serial/serial_octeon_pcie_console.c   |  4 +-
 drivers/serial/serial_pl01x.c                 |  8 +-
 drivers/serial/serial_sifive.c                |  2 +-
 drivers/serial/serial_zynq.c                  |  2 +-
 drivers/spi/mtk_snfi_spi.c                    |  2 +-
 drivers/spi/octeon_spi.c                      |  2 +-
 drivers/spi/stm32_qspi.c                      |  2 +-
 drivers/timer/mpc83xx_timer.c                 |  4 +-
 drivers/usb/eth/lan7x.h                       |  4 +-
 drivers/usb/gadget/f_acm.c                    |  4 +-
 drivers/usb/gadget/f_sdp.c                    |  4 +-
 drivers/usb/host/ehci-hcd.c                   |  2 +-
 drivers/usb/musb-new/musb_uboot.c             |  2 +-
 drivers/video/video_bmp.c                     |  4 +-
 drivers/watchdog/Kconfig                      |  2 +
 drivers/watchdog/wdt-uclass.c                 | 80 +++++++++++--------
 env/common.c                                  |  2 +-
 fs/cramfs/uncompress.c                        |  3 +-
 fs/jffs2/jffs2_1pass.c                        |  2 +-
 include/cyclic.h                              |  5 ++
 include/linux/compat.h                        |  2 +-
 include/wait_bit.h                            |  2 +-
 include/watchdog.h                            | 68 +---------------
 lib/bzip2/bzlib.c                             |  2 +-
 lib/bzip2/bzlib_decompress.c                  |  8 +-
 lib/crc32.c                                   |  2 +-
 lib/efi_loader/efi_boottime.c                 |  4 +-
 lib/gunzip.c                                  |  2 +-
 lib/lzma/LzmaDec.c                            | 16 ++--
 lib/lzma/LzmaTools.c                          |  2 +-
 lib/md5.c                                     |  2 +-
 lib/sha1.c                                    |  2 +-
 lib/sha256.c                                  |  2 +-
 lib/sha512.c                                  |  4 +-
 lib/time.c                                    |  2 +-
 lib/zlib/inflate.c                            |  8 +-
 net/net.c                                     |  2 +-
 post/cpu/mpc83xx/ecc.c                        |  2 +-
 post/drivers/memory.c                         | 36 ++++-----
 post/lib_powerpc/cpu.c                        | 16 ++--
 post/lib_powerpc/fpu/fpu.c                    |  4 +-
 post/post.c                                   |  4 +-
 test/common/cyclic.c                          |  2 +-
 test/dm/wdt.c                                 |  9 ++-
 110 files changed, 310 insertions(+), 339 deletions(-)
Cc Joel Stanley <[email protected]>
Cc Chia-Wei Wang <[email protected]>
Signature · 1 line
2.37.2