diff options
author | Mika Westerberg <[email protected]> | 2021-09-21 13:29:00 +0300 |
---|---|---|
committer | Wim Van Sebroeck <[email protected]> | 2021-10-26 21:31:12 +0200 |
commit | 1ae3e78c08209ac657c59f6f7ea21bbbd7f6a1d4 (patch) | |
tree | 8e5a246df37e6c47106edb5e5949547a74a0a124 | |
parent | 981785da79f0bfecdd328f49e6473c232e3a6bdb (diff) |
watchdog: iTCO_wdt: No need to stop the timer in probe
The watchdog core can handle pinging of the watchdog before userspace
opens the device. For this reason instead of stopping the timer, just
mark it as running and let the watchdog core take care of it.
Cc: Malin Jonsson <[email protected]>
Signed-off-by: Mika Westerberg <[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]>
-rw-r--r-- | drivers/watchdog/iTCO_wdt.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 16ad2c9842c2..3f2f4343644f 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c @@ -423,6 +423,16 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev) return time_left; } +static void iTCO_wdt_set_running(struct iTCO_wdt_private *p) +{ + u16 val; + + /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is * enabled */ + val = inw(TCO1_CNT(p)); + if (!(val & BIT(11))) + set_bit(WDOG_HW_RUNNING, &p->wddev.status); +} + /* * Kernel Interfaces */ @@ -562,8 +572,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev) watchdog_set_drvdata(&p->wddev, p); platform_set_drvdata(pdev, p); - /* Make sure the watchdog is not running */ - iTCO_wdt_stop(&p->wddev); + iTCO_wdt_set_running(p); /* Check that the heartbeat value is within it's range; if not reset to the default */ |