Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Removing the manual watchdog timeout reset during driver initialization while continuing to unconditionally force the hardware into 'seconds' mode causes a severe timeout truncation. If the BIOS left the watchdog running with a 'minutes' timebase (e.g., 5 minutes), the raw hardware register value (e.g., 5) is preserved but its unit is instantly reinterpreted as seconds, leaving a window of only 5 seconds before the watchdog fires.
--
commit 41d13e5a4078e3d18e184d179b1d408461a148bd
Author: Paul Louvel <[email protected]>
watchdog: w83627hf_wdt: Use WDOG_HW_RUNNING for running chip on boot
This commit replaces the manual watchdog refresh during initialization
with the WDOG_HW_RUNNING flag. It delegates keepalives to the watchdog core
when the device is already running on boot.
> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
> index 1f649fda8a813..5348c0f79de8f 100644
> --- a/drivers/watchdog/w83627hf_wdt.c
> +++ b/drivers/watchdog/w83627hf_wdt.c
> @@ -240,9 +240,8 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
> pr_warn("Stopping previously enabled watchdog until userland kicks in\n");
> superio_outb(cr_wdt_timeout, 0);
> } else {
> - pr_info("Watchdog already running. Resetting timeout to %d sec\n",
> - wdog->timeout);
> - superio_outb(cr_wdt_timeout, wdog->timeout);
> + pr_info("Watchdog already running.\n");
> + set_bit(WDOG_HW_RUNNING, &wdog->status);
> }
> }
>
[Severity: High]
Does removing this timeout reset cause a timeout truncation issue?
Immediately after this block, w83627hf_init() forces the hardware timebase
into seconds mode:
/* set second mode & disable keyboard turning off watchdog */
t = superio_inb(cr_wdt_control) & ~0x0C;
superio_outb(cr_wdt_control, t);
If the BIOS previously left the watchdog running with a 'minutes' timebase
(for example, 5 minutes), the raw hardware register value (5) is preserved.
However, because the timebase is instantly reinterpreted as seconds, the
system is left with a window of only 5 seconds before the watchdog fires.
This can lead to spurious reboots during the OS boot phase before the watchdog
core or user space can issue the next ping.
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.