watchdog: rti_wdt: Allow timeout config with timeout-sec
PATCH 1/1 watchdog: rti_wdt: Allow timeout config with timeout-sec
Currently rti_wdt does not allow timeout to be configured via DT property timeout-sec, so fix watchdog_init_timeout to be able to use timeout-sec.
--- drivers/watchdog/rti_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/watchdog/rti_wdt.c +2 -1
@@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)memunmap (vaddr); } -watchdog_init_timeout (wdd, heartbeat, dev); + wdd->timeout = heartbeat; +watchdog_init_timeout (wdd,0 , dev); ret =watchdog_register_device (wdd);if (ret) {
base-commit: 860bbe8e618fd62446309e286ab4a83d38201c0a
Signature · 1 line
2.46.0
Guenter Roeck
maintainerQuoted 14 lines · Judith Mendez
Currently
rti_wdtdoes not allow timeout to be configured via DT property timeout-sec, so fixwatchdog_init_timeoutto be able to use timeout-sec.Signed-off-by Judith Mendez <[email protected]>--- drivers/watchdog/rti_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/watchdog/rti_wdt.c +0
-0
drivers/watchdog/rti_wdt.c static int rti_wdt_probe(struct platform_device *pdev) · line 335
Quoted 5 lines
drivers/watchdog/rti_wdt.c +1
-1@@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)memunmap (vaddr); } -watchdog_init_timeout (wdd, heartbeat, dev); + wdd->timeout = heartbeat;
The proper fix would be to initialize the 'heartbeat' variable with 0, set wdt->timeout to DEFAULT_HEARTBEAT, and to keep passing 'heartbeat' to watchdog_init_timeout(). That used to be done but was explicitly changed in an earlier commit, presumably on purpose. I am not inclined to accept a (partial) revert unless the author of commit 5527483f confirms that this is acceptable and desirable. Otherwise we'll just end up in an edit war, which I really don't want to get into.
Guenter
`
Quoted 9 lines
drivers/watchdog/rti_wdt.c +1
-0+watchdog_init_timeout (wdd,0 , dev); ret =watchdog_register_device (wdd);if (ret) {base-commit:
860bbe8e618fd62446309e286ab4a83d38201c0aSignature · 1 line
2.46.0
Hi Guenter,
Quoted 18 lines · Guenter Roeck
Quoted 17 lines · Judith Mendez
Currently
rti_wdtdoes not allow timeout to be configured via DT property timeout-sec, so fixwatchdog_init_timeoutto be able to use timeout-sec.Signed-off-by Judith Mendez <[email protected]>--- drivers/watchdog/rti_wdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/watchdog/rti_wdt.c +0
-0@@ -332,7 +332,8 @@ static int rti_wdt_probe(struct platform_device *pdev)memunmap (vaddr); }
Quoted 10 lines
drivers/watchdog/rti_wdt.c static int rti_wdt_probe(struct platform_device *pdev) · line 335
Quoted 2 lines
drivers/watchdog/rti_wdt.c +1
-1-watchdog_init_timeout (wdd, heartbeat, dev); + wdd->timeout = heartbeat;The proper fix would be to initialize the 'heartbeat' variable with 0, set
wdt->timeouttoDEFAULT_HEARTBEAT, and to keep passing 'heartbeat' towatchdog_init_timeout(). That used to be done but was explicitly changed in an earlier commit, presumably on purpose. I am not inclined to accept a (partial) revert unless the author of commit5527483fconfirms that this is acceptable and desirable. Otherwise we'll just end up in an edit war, which I really don't want to get into.
You are right, I completely missed this change in this commit due to the subject line not being related. I will try to align with Tero Kristo to see if this is something we can add back. Thanks.
~ Judith
Quoted 13 lines
Guenter
`Quoted 9 lines
drivers/watchdog/rti_wdt.c +1
-0+watchdog_init_timeout (wdd,0 , dev); ret =watchdog_register_device (wdd);if (ret) {base-commit:
860bbe8e618fd62446309e286ab4a83d38201c0aSignature · 1 line
2.46.0