Re: [PATCH v2] watchdog: intel_oc_wdt: Stop the watchdog during system sleep
From: Guenter Roeck
Date: Fri Nov 20 2026 - 20:32:20 EST
On Fri, Nov 20, 2026 at 11:23:09AM +0100, Paul Menzel wrote:
> The driver has no system sleep callbacks, so a running watchdog keeps
> counting in suspend-to-idle. Suspend-to-idle stops the tick, so neither
> user space nor the watchdog core can ping it, and the watchdog resets
> the machine once the timeout expires.
>
> On a Dell XPS 13 9310 (Tiger Lake, BIOS 3.17.0, no ACPI S3) with systemd
> `RuntimeWatchdogSec=30s` on /dev/watchdog-oc, both `rtcwake -m freeze -s
> 900` and `rtcwake -m freeze -s 60` resulted in a reset about 30 s after
> entering suspend, without any message in the journal or in pstore. With
> the systemd runtime watchdog disabled, the system stayed in
> suspend-to-idle for 900 s and resumed normally.
>
> Stop the watchdog in the noirq suspend phase and restart it, with a
> reload, in the noirq resume phase, as iTCO_wdt does. Check the enable
> bit in hardware rather than watchdog_active(), so a watchdog started by
> the firmware, which only the watchdog core pings, is covered too. If the
> control register is locked, the watchdog cannot be stopped, so leave it
> alone.
>
> Also program the timeout again on resume, whether or not the watchdog
> was running: the platform firmware may reset the control register, and
> when resuming from hibernation, it holds the timeout the boot kernel
> set. intel_oc_wdt_start() only sets the enable bit, so a timeout set
> with WDIOC_SETTIMEOUT would otherwise be lost.
>
> Unlike iTCO_wdt, do this for all sleep states and not only for
> suspend-to-idle, as it is not documented whether the platform firmware
> stops the OC watchdog in ACPI S3 or S4. Hangs in the device suspend and
> resume callbacks outside the noirq phases are still caught.
>
> Tested on a Dell XPS 13 9310 (BIOS 3.17.0) with the module built for
> 7.4.0-rc1 and systemd RuntimeWatchdogSec=30s:
>
> - rtcwake -m freeze -s 120 resumes normally; the stock module reset the
> machine in 2 of 2 attempts.
> - TOV restore: with the watchdog armed, overwrite TOV with 0x3b (60 s) via
> outl, as the firmware might, then rtcwake -m freeze -s 60. v1: register
> 0x0080603b after resume (TOV 60 s kept). v2: 0x0080601d (TOV 30 s
> restored, EN set), watchdog still running 40 s later.
>
> Fixes: 535d1784d8a9 ("watchdog: Add driver for Intel OC WDT")
> Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
Applied.
Thanks,
Guenter