Skip to content

Commit 4f39d57

Browse files
a3fWim Van Sebroeck
authored andcommitted
watchdog: f71808e_wdt: clear watchdog timeout occurred flag
The flag indicating a watchdog timeout having occurred normally persists till Power-On Reset of the Fintek Super I/O chip. The user can clear it by writing a `1' to the bit. The driver doesn't offer a restart method, so regular system reboot might not reset the Super I/O and if the watchdog isn't enabled, we won't touch the register containing the bit on the next boot. In this case all subsequent regular reboots will be wrongly flagged by the driver as being caused by the watchdog. Fix this by having the flag cleared after read. This is also done by other drivers like those for the i6300esb and mpc8xxx_wdt. Fixes: b97cb21 ("watchdog: f71808e_wdt: Fix WDTMOUT_STS register read") Cc: [email protected] Signed-off-by: Ahmad Fatoum <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 8021414 commit 4f39d57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/watchdog/f71808e_wdt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,13 @@ static int __init watchdog_init(int sioaddr)
706706
wdt_conf = superio_inb(sioaddr, F71808FG_REG_WDT_CONF);
707707
watchdog.caused_reboot = wdt_conf & BIT(F71808FG_FLAG_WDTMOUT_STS);
708708

709+
/*
710+
* We don't want WDTMOUT_STS to stick around till regular reboot.
711+
* Write 1 to the bit to clear it to zero.
712+
*/
713+
superio_outb(sioaddr, F71808FG_REG_WDT_CONF,
714+
wdt_conf | BIT(F71808FG_FLAG_WDTMOUT_STS));
715+
709716
superio_exit(sioaddr);
710717

711718
err = watchdog_set_timeout(timeout);

0 commit comments

Comments
 (0)