Skip to content

clocksource/drivers/timer-vt8500: clean up and add watchdog function

Alexey Charkov linux-arm-kernel linux-watchdog lkml 7 versions – New

Get series with b4
b4 am [email protected] change-id 20250506-vt8500-timer-updates-44a0d22cd720

Versions newest first

  1. v7 Latest4 patches 0 repliesNew
  2. v64 patches 2 repliesSuperseded
  3. v54 patches 5 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches5 repliesSuperseded
v34 patches4 repliesSuperseded
v24 patches3 repliesApplied
v13 patches6 repliesSuperseded

Changes in v7 from the cover letter

- Rebased onto next-20261112
- Register the restart handler at priority 0, the last resort, so that
it runs after the machine's own restart hook regardless of
registration order (thanks Guenter)
- Wait for the reset to assert after arming the watchdog in the restart
handler, rather than return and let later handlers run (thanks Guenter)
- Link to v6: https://patch.msgid.link/[email protected]

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4clocksource/drivers/timer-vt8500: Add defines for magic constantsdrivers/clocksource/timer-vt8500.c+39 -230 replies
2/4clocksource/drivers/timer-vt8500: Prepare for watchdog functionalityMAINTAINERS drivers/clocksource/Kconfig drivers/clocksource/timer-vt8500.c +1 more+142 -90 replies
3/4watchdog: Add support for VIA/WonderMedia SoC watchdog functionalityDocumentation/watchdog/watchdog-parameters.rst MAINTAINERS drivers/watchdog/Kconfig +2 more+153 -00 replies
4/4watchdog: vt8500: Add a restart handlerdrivers/watchdog/vt8500-wdt.c+18 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 0/4] clocksource/drivers/timer-vt8500: clean up and add watchdog function

Add named defines for the registers and bits in timer-vt8500. Move the system events timer from channel 0 to channel 1 when enough information is provided by the device tree (i.e. more than one IRQ). Use channel 0 for the system watchdog, and let the watchdog restart the SoC, which the machine's own restart hook fails to do on WM8950.

---
Changes in v7:
- Rebased onto next-20261112
- Register the restart handler at priority 0, the last resort, so that
it runs after the machine's own restart hook regardless of
registration order (thanks Guenter)
- Wait for the reset to assert after arming the watchdog in the restart
handler, rather than return and let later handlers run (thanks Guenter)
- Link to v6: https://patch.msgid.link/[email protected]

Changes in v6:
- Dropped the binding patch, which Rob has applied
- Rebased onto next-20261111
- Moved the shared header under include/clocksource (thanks Daniel)
- Pass the watchdog a single register base, and keep the watchdog
register offsets in its own driver (thanks Daniel)
- Build the watchdog driver in rather than as a module: the timer it
depends on is always built in, and the driver is tiny (thanks Daniel)
- kfree the correct structure upon aux child release (thanks Daniel)
- Return -ENODEV rather than -ENOMEM if the timer failed to initialize,
and drop the message on allocation failure (thanks Daniel)
- Unmap the timer registers if its interrupt is missing, so that no
watchdog gets created on a timer that never started
- Improved code comments and commit messages (thanks Daniel)
- Give the watchdog a default timeout, so that opening the device
before setting one no longer arms it for the next counter wraparound
- Wait for a pending match register write to settle before rewriting it,
as the clock event code does
- Honour the nowayout parameter, and disallow unbinding the watchdog,
which would leave it armed with nothing to ping it
- Added a restart handler, so that reboot works on WM8950
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Make sure the watchdog timeout value is clamped to hardware limits
before writing it to the registers (thanks Guenter)
- Add a comment about the watchdog match value (deadline) wrapping around
the U32_MAX boundary, which is expected behavior (thanks Guenter)
- Avoid moving register definitions to the shared header file to reduce
churn: the watchdog driver gets direct pointers to the two registers it
uses anyway, so it doesn't have to know all those offsets and bits
- Put the watchdog Kconfig entry with other ARM platforms where it belongs
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Changed the watchdog driver to use auxiliary bus instead of platform
(thanks Guenter)
- Split out the register definitions into a header file shared between
the clocksource driver and the watchdog driver
- Replaced -1UL with U32_MAX in watchdog max_heartbeat_ms to make builds
on non-32bit platforms happier
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Dropped the DTS patch already applied by Krzysztof
- Rebased onto v6.15-rc5 as requested by Daniel
- Split out the watchdog code into a dedicated platform driver, like
timer-gxp does (thanks Daniel)
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Included the previously reviewed binding change that is directly related
to this series as the first patch here (thanks Krzysztof)
- Created a separate config symbol for the watchdog function to let users
build a kernel without forcing watchdog functionality upon them
(thanks Krzysztof)
- Link to the previous binding submission: https://lore.kernel.org/all/[email protected]/

---
Alexey Charkov (4):
clocksource/drivers/timer-vt8500: Add defines for magic constants clocksource/drivers/timer-vt8500: Prepare for watchdog functionality
watchdog: Add support for VIA/WonderMedia SoC watchdog functionality
watchdog: vt8500: Add a restart handler

 Documentation/watchdog/watchdog-parameters.rst |   7 +
 MAINTAINERS                                    |   2 +
 drivers/clocksource/Kconfig                    |   1 +
 drivers/clocksource/timer-vt8500.c             | 179 +++++++++++++++++++++----
 drivers/watchdog/Kconfig                       |  12 ++
 drivers/watchdog/Makefile                      |   1 +
 drivers/watchdog/vt8500-wdt.c                  | 150 +++++++++++++++++++++
 include/clocksource/vt8500-timer.h             |  22 +++
 8 files changed, 347 insertions(+), 27 deletions(-)

---
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
change-id: 20250506-vt8500-timer-updates-44a0d22cd720

Best regards,

Signature · 1 line
Alexey Charkov <[email protected]>