summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2026-11-08 09:16:21 -0800
committerGuenter Roeck <linux@roeck-us.net>2026-11-09 15:13:35 -0800
commit9325e8c1853e622317c46a090b85f436f9ba1443 (patch)
tree0f3dd5260a67bf758ebcb3273786fb151b309bac /tools/perf/scripts/python
parent57c7cbe21acc77291ec0fbdd4bd72aa259cf4986 (diff)
watchdog: omap: Fix early_enable handling in omap_wdt_probe()
Commit cd004d8299f1 ("watchdog: Fix OMAP watchdog early handling") updated omap_wdt_probe() to call omap_wdt_start() and set WDOG_HW_RUNNING before watchdog_register_device() when the early_enable module parameter is enabled, introducing two bugs: 1. During probe, omap_wdt_probe() acquires an initial runtime PM reference via pm_runtime_get_sync(), and omap_wdt_start() sets omap_wdt_users, acquires a second runtime PM reference, and enables the hardware timer. If watchdog_register_device() subsequently fails, the error path drops only the initial runtime PM reference without calling omap_wdt_stop(), leaking the second runtime PM reference and leaving the hardware timer counting down without a registered watchdog device or core keepalive worker to service it, causing an unexpected system reset. 2. The original post-registration omap_wdt_start() call was left in place, so when early_enable is enabled and registration succeeds, omap_wdt_start() is called a second time. This leaks a runtime PM reference (preventing runtime suspend even after the watchdog is stopped) and races with userspace after /dev/watchdog is exposed, potentially re-enabling the hardware timer after userspace has reconfigured or stopped it. Stop the watchdog via omap_wdt_stop() when omap_wdt_users is set on watchdog_register_device() failure, and remove the duplicate post-registration omap_wdt_start() call. Fixes: cd004d8299f1 ("watchdog: Fix OMAP watchdog early handling") Cc: Walter Stoll <walter.stoll@duagon.com> Cc: Wentao Liang <vulab@iscas.ac.cn> Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://sashiko.dev/#/bug/linux-80221bbd-42ac-4fc0-bc11-3d1fd19f7c32 Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20261108171621.1042105-1-linux@roeck-us.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions