diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2026-10-27 09:03:53 -0700 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-11-16 13:26:12 -0800 |
| commit | d8cda274400b52c5bb542158ae9f220f72f059f0 (patch) | |
| tree | 2d436a3619fc6e7c7861d04548024b6992ca82a1 /rust/kernel/alloc/allocator | |
| parent | e1d91be1ec2e68458d4e4eef33b0401016c54e26 (diff) | |
watchdog: core: Update last_keepalive in watchdog_start()
When starting a watchdog whose hardware is already running,
watchdog_start() calls __watchdog_ping() before marking the watchdog
active, and fails to update wd_data->last_keepalive. As a result:
1. wd_data->last_keepalive remains 0, causing watchdog_get_timeleft() to
calculate the elapsed time since the epoch and return 0 time left.
2. watchdog_update_worker() inside __watchdog_ping() evaluates
watchdog_need_worker() and watchdog_next_keepalive() while WDOG_ACTIVE
is still clear, using wd_data->open_deadline instead of
wd_data->last_keepalive. If open_deadline has expired, the background
keepalive timer is not armed; conversely, if the active watchdog does
not need a worker, the boot keepalive timer is not canceled.
Set WDOG_ACTIVE and wd_data->last_keepalive to started_at before calling
__watchdog_ping(), and revert WDOG_ACTIVE and update the worker if
__watchdog_ping() fails.
Fixes: fbbe35dfcf94 ("watchdog: use __watchdog_ping in startup")
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20261027160353.2519323-3-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust/kernel/alloc/allocator')
0 files changed, 0 insertions, 0 deletions
