]> git.ipfire.org Git - thirdparty/systemd.git/commit
manager: Fix HW watchdog when systemd starts before driver loaded
authorMichael Marley <michael@michaelmarley.com>
Tue, 8 Dec 2020 02:27:38 +0000 (21:27 -0500)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 9 Dec 2020 11:47:22 +0000 (11:47 +0000)
commit61927b9f116bf45bfdbf19dc2981d4a4f527ae5f
treed9bf3607f89d3ae64fb2f362feda07b8a1feb7c3
parent9e36b885b894f1b2a53fa234a238e736582021c4
manager: Fix HW watchdog when systemd starts before driver loaded

When manager_{set|override}_watchdog is called, set the watchdog timeout
regardless of whether the hardware watchdog was successfully initialized.  If
the watchdog was requested but could not be initialized, then instead of
pinging it, attempt to initialize it again.  This ensures that the hardware
watchdog is initialized even if the kernel module for it isn't loaded when
systemd starts (which is quite likely, unless it is compiled in).

This builds on work by @danc86 in https://github.com/systemd/systemd/pull/17460,
but fixes the issue of not updating the watchdog timeout with the actual value
from the hardware.

Fixes https://github.com/systemd/systemd/issues/17838

Co-authored-by: Dan Callaghan <djc@djc.id.au>
Co-authored-by: Michael Marley <michael@michaelmarley.com>
src/core/manager.c
src/core/manager.h