Skip to content

Commit 88b2ab3

Browse files
rxrblnWim Van Sebroeck
authored andcommitted
fix it87_wdt early reboot by reporting running timer
Some products, such as the Ugreen DXP4800 Plus NAS, ship with the it87 wdt enabled by the firmware and a broken BIOS option that does not allow to change the time or turn it off. As this makes installing Linux rather difficult, change the it87_wdt to report it running to the watchdog core. Signed-off-by: René Rebe <rene@exactco.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 0f61b18 commit 88b2ab3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/watchdog/it87_wdt.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ static void _wdt_update_timeout(unsigned int t)
188188
superio_outb(t >> 8, WDTVALMSB);
189189
}
190190

191+
/* Internal function, should be called after superio_select(GPIO) */
192+
static bool _wdt_running(void)
193+
{
194+
return superio_inb(WDTVALLSB) || (max_units > 255 && superio_inb(WDTVALMSB));
195+
}
196+
191197
static int wdt_update_timeout(unsigned int t)
192198
{
193199
int ret;
@@ -374,6 +380,12 @@ static int __init it87_wdt_init(void)
374380
}
375381
}
376382

383+
/* wdt already left running by firmware? */
384+
if (_wdt_running()) {
385+
pr_info("Left running by firmware.\n");
386+
set_bit(WDOG_HW_RUNNING, &wdt_dev.status);
387+
}
388+
377389
superio_exit();
378390

379391
if (timeout < 1 || timeout > max_units * 60) {

0 commit comments

Comments
 (0)