All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paul Louvel" <paul.louvel@bootlin.com>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v2 2/2] watchdog: w83627hf_wdt: Use WDOG_HW_RUNNING for running chip on boot
Date: Mon, 06 Jul 2026 10:37:07 +0000	[thread overview]
Message-ID: <20260706103708.333311F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260706-w83627hf_wdt-nct6126d-v2-2-77af74af88ae@bootlin.com>

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 <paul.louvel@bootlin.com>

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/20260706-w83627hf_wdt-nct6126d-v2-0-77af74af88ae@bootlin.com?part=2

      reply	other threads:[~2026-07-06 10:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 10:19 [PATCH v2 0/2] watchdog: w83627hf_wdt: Add NCT6126 support and improve handling of running watchdog Paul Louvel
2026-07-06 10:19 ` [PATCH v2 1/2] watchdog: w83627hf_wdt: Add support for Nuvoton NCT6126 Paul Louvel
2026-07-06 10:30   ` sashiko-bot
2026-07-06 10:19 ` [PATCH v2 2/2] watchdog: w83627hf_wdt: Use WDOG_HW_RUNNING for running chip on boot Paul Louvel
2026-07-06 10:37   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260706103708.333311F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=paul.louvel@bootlin.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.