Commit 88b2ab34 authored by René Rebe's avatar René Rebe Committed by Wim Van Sebroeck
Browse files

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: default avatarRené Rebe <rene@exactco.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 0f61b186
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -188,6 +188,12 @@ static void _wdt_update_timeout(unsigned int t)
		superio_outb(t >> 8, WDTVALMSB);
}

/* Internal function, should be called after superio_select(GPIO) */
static bool _wdt_running(void)
{
	return superio_inb(WDTVALLSB) || (max_units > 255 && superio_inb(WDTVALMSB));
}

static int wdt_update_timeout(unsigned int t)
{
	int ret;
@@ -374,6 +380,12 @@ static int __init it87_wdt_init(void)
		}
	}

	/* wdt already left running by firmware? */
	if (_wdt_running()) {
		pr_info("Left running by firmware.\n");
		set_bit(WDOG_HW_RUNNING, &wdt_dev.status);
	}

	superio_exit();

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