diff options
| author | Zhao Feng <zhaofeng2@cmss.chinamobile.com> | 2026-11-09 15:10:03 +0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-11-09 15:06:45 -0800 |
| commit | 57c7cbe21acc77291ec0fbdd4bd72aa259cf4986 (patch) | |
| tree | a2547f1eea718a76c4ef5a7444f45cd04a05cf3e /tools/perf/scripts/python | |
| parent | f0dfc756bb46235068279755249131c2a7130111 (diff) | |
watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
npcm_wdt_start() unconditionally prepares and enables the watchdog
clock, and npcm_wdt_stop() is the only place that disables it.
npcm_wdt_set_timeout() calls npcm_wdt_start() again whenever the
watchdog is already active, so every WDIOC_SETTIMEOUT ioctl issued
while the watchdog is running takes one extra clock prepare/enable
reference that is never dropped.
Split the register programming out of npcm_wdt_start() into a
__npcm_wdt_start() helper that assumes the clock is already running,
and call the helper from npcm_wdt_set_timeout() instead; only the
watchdog .start callback (and the restart path, which intentionally
keeps the clock) now acquires the clock.
Fixes: af084fdccfaf ("watchdog: npcm: Enable clock if provided")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261109071004.1506-1-zhaofeng2@cmss.chinamobile.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
