Skip to content

Commit 158f9f2

Browse files
Ziyan FuWim Van Sebroeck
authored andcommitted
watchdog: iTCO_wdt: Update the heartbeat value after clamping timeout
When executing "modprobe iTCO_wdt heartbeat=700", the user-specified 'heartbeat' parameter exceeds the valid range, the driver clamps the timeout to default 30s but fails to update the logged 'heartbeat' value, resulting in misleading log output: iTCO_wdt iTCO_wdt: timeout value out of range, using 30 iTCO_wdt iTCO_wdt: initialized. heartbeat=700 sec (nowayout=0) After validating the range, update the 'heartbeat' value with the clamped timeout value to ensure that log messages accurately reflect the actual runtime parameters. Signed-off-by: Ziyan Fu <[email protected]> Reviewed-by: Wim Van Sebroeck <[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 535d178 commit 158f9f2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/watchdog/iTCO_wdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
580580
iTCO_wdt_set_timeout(&p->wddev, WATCHDOG_TIMEOUT);
581581
dev_info(dev, "timeout value out of range, using %d\n",
582582
WATCHDOG_TIMEOUT);
583+
heartbeat = WATCHDOG_TIMEOUT;
583584
}
584585

585586
watchdog_stop_on_reboot(&p->wddev);

0 commit comments

Comments
 (0)