Skip to content
/ linux Public

Commit 1d71202

Browse files
rxrblnSasha Levin
authored andcommitted
fix it87_wdt early reboot by reporting running timer
[ Upstream commit 88b2ab3 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4ff5ab3 commit 1d71202

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/watchdog/it87_wdt.c

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

186+
/* Internal function, should be called after superio_select(GPIO) */
187+
static bool _wdt_running(void)
188+
{
189+
return superio_inb(WDTVALLSB) || (max_units > 255 && superio_inb(WDTVALMSB));
190+
}
191+
186192
static int wdt_update_timeout(unsigned int t)
187193
{
188194
int ret;
@@ -365,6 +371,12 @@ static int __init it87_wdt_init(void)
365371
}
366372
}
367373

374+
/* wdt already left running by firmware? */
375+
if (_wdt_running()) {
376+
pr_info("Left running by firmware.\n");
377+
set_bit(WDOG_HW_RUNNING, &wdt_dev.status);
378+
}
379+
368380
superio_exit();
369381

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

0 commit comments

Comments
 (0)