Skip to content

Commit 1ae3e78

Browse files
westeriWim Van Sebroeck
authored andcommitted
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]>
1 parent 981785d commit 1ae3e78

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/watchdog/iTCO_wdt.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,16 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)
423423
return time_left;
424424
}
425425

426+
static void iTCO_wdt_set_running(struct iTCO_wdt_private *p)
427+
{
428+
u16 val;
429+
430+
/* Bit 11: TCO Timer Halt -> 0 = The TCO timer is * enabled */
431+
val = inw(TCO1_CNT(p));
432+
if (!(val & BIT(11)))
433+
set_bit(WDOG_HW_RUNNING, &p->wddev.status);
434+
}
435+
426436
/*
427437
* Kernel Interfaces
428438
*/
@@ -562,8 +572,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
562572
watchdog_set_drvdata(&p->wddev, p);
563573
platform_set_drvdata(pdev, p);
564574

565-
/* Make sure the watchdog is not running */
566-
iTCO_wdt_stop(&p->wddev);
575+
iTCO_wdt_set_running(p);
567576

568577
/* Check that the heartbeat value is within it's range;
569578
if not reset to the default */

0 commit comments

Comments
 (0)