Re: [PATCH] watchdog: omap: Do not read the counter while the watchdog is stopped
From: Guenter Roeck
Date: Fri Nov 20 2026 - 14:20:53 EST
On 11/20/26 04:40, Nhat Tran wrote:
omap_wdt only holds a runtime PM reference between omap_wdt_start() and
omap_wdt_stop(), so the module is idle and its clock gated whenever the
watchdog is not running. omap_wdt_get_timeleft() reads the WCRR register
unconditionally, but the watchdog core calls ->get_timeleft() from the
sysfs timeleft attribute without checking whether the watchdog is
active.
With CONFIG_WATCHDOG_SYSFS=y the attribute is world readable, so any
The watchdog can also be stopped while the watchdog device is open, so the
problem is a bit broader than that.
unprivileged user can trigger an external abort on a stopped watchdog.
On a BeagleBone Black (AM335x), with panic_on_oops set:
Seems to me the proper generic fix should be in watchdog_get_timeleft(),
which should return either return the configured timeout or maybe 0
(I am open to suggestions) if the watchdog is not running.
Thanks,
Guenter