watchdog/softlockup: Enforce that timestamp is valid on boot
authorThomas Gleixner <tglx@linutronix.de>
Thu, 16 Jan 2020 18:17:02 +0000 (19:17 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 17 Jan 2020 10:19:22 +0000 (11:19 +0100)
commit11e31f608b499f044f24b20be73f1dcab3e43f8a
tree404752a4c23a29b8471671ecb12ffbc127b47531
parent3a51449b7959f68cc45abe67298e40c7eb57167b
watchdog/softlockup: Enforce that timestamp is valid on boot

Robert reported that during boot the watchdog timestamp is set to 0 for one
second which is the indicator for a watchdog reset.

The reason for this is that the timestamp is in seconds and the time is
taken from sched clock and divided by ~1e9. sched clock starts at 0 which
means that for the first second during boot the watchdog timestamp is 0,
i.e. reset.

Use ULONG_MAX as the reset indicator value so the watchdog works correctly
right from the start. ULONG_MAX would only conflict with a real timestamp
if the system reaches an uptime of 136 years on 32bit and almost eternity
on 64bit.

Reported-by: Robert Richter <rrichter@marvell.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/87o8v3uuzl.fsf@nanos.tec.linutronix.de
kernel/watchdog.c