[PATCH v4] watchdog: sbsa_gwdt: add early_enable module parameter
Guenter Roeck
linux at roeck-us.net
Fri Aug 21 13:24:59 PDT 2026
On Mon, Aug 17, 2026 at 10:37:49AM +0800, Zexin Wang wrote:
> On SBSA platforms using standard UEFI firmware (such as EDK II), the
> watchdog timer is often enabled during early boot stages but explicitly
> disabled by the firmware before handing over control to the OS (e.g.,
> during ExitBootServices). This is done to prevent unintended resets
> while the OS is loading, assuming the OS watchdog driver will take over.
>
> However, this leaves a protection gap. If the system hangs between the
> firmware handover and the userspace watchdog daemon startup, the hardware
> watchdog will not fire to recover the system. For safety-critical systems
> that require continuous hardware watchdog protection from the earliest
> possible moment, this gap is problematic.
>
> Add an 'early_enable' module parameter to allow the kernel driver to
> re-enable the watchdog immediately during probe if it was left disabled
> by the firmware. By setting the WDOG_HW_RUNNING status bit, the watchdog
> core is instructed that the hardware is active. As a result, the core's
> pre-userspace handler (controlled by 'handle_boot_enabled') will
> automatically issue periodic keepalives until userspace opens the device.
>
> This bridges the protection gap seamlessly without requiring firmware
> modifications and without risking unintended resets during kernel boot.
>
> The parameter defaults to false to preserve the traditional behavior.
>
> Signed-off-by: Zexin Wang <ot_zexin.wang at mediatek.com>
Applied.
Thanks,
Guenter
More information about the Linux-mediatek
mailing list