Commit 1ae3e78c authored by Mika Westerberg's avatar Mika Westerberg Committed by Wim Van Sebroeck

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 <malin.jonsson@ericsson.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210921102900.61586-1-mika.westerberg@linux.intel.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 981785da
...@@ -423,6 +423,16 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev) ...@@ -423,6 +423,16 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)
return time_left; 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 * Kernel Interfaces
*/ */
...@@ -562,8 +572,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev) ...@@ -562,8 +572,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(&p->wddev, p); watchdog_set_drvdata(&p->wddev, p);
platform_set_drvdata(pdev, p); platform_set_drvdata(pdev, p);
/* Make sure the watchdog is not running */ iTCO_wdt_set_running(p);
iTCO_wdt_stop(&p->wddev);
/* Check that the heartbeat value is within it's range; /* Check that the heartbeat value is within it's range;
if not reset to the default */ if not reset to the default */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment