Skip to contentSkip to conversation

watchdog: dw_wdt: ping watchdog to reset countdown before start

PATCH In review Jack Mitchell 2 participants 2 messages Jan 7, 2020 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 watchdog: dw_wdt: ping watchdog to reset countdown before start

Currently on an rk3288 SoC when trying to use the watchdog the SoC will instantly reset. This is due to the watchdog countdown counter being set to its initial value of 0x0. Reset the watchdog counter before start in order to correctly start the countdown timer from the right position.

---
 drivers/watchdog/dw_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/dw_wdt.c +1 -0
index fef7c61f5555..4a902d015bc2 100644
@@ -135,6 +135,7 @@ static int dw_wdt_start(struct watchdog_device *wdd)
 	struct dw_wdt *dw_wdt = to_dw_wdt(wdd);
 
 	dw_wdt_set_timeout(wdd, wdd->timeout);
+	dw_wdt_ping(&dw_wdt->wdd);
 	dw_wdt_arm_system_reset(dw_wdt);
 
 	return 0;
Signature · 1 line
2.24.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Jack Mitchell

Currently on an rk3288 SoC when trying to use the watchdog the SoC will instantly reset. This is due to the watchdog countdown counter being set to its initial value of 0x0. Reset the watchdog counter before start in order to correctly start the countdown timer from the right position.

You sent this three times, one with v2, no explanation for v2. On top of that, the To: destination is messed up in all three versions. Excellent example for how not to send a patch.

Anyway,

Quoted 19 lines
---
 drivers/watchdog/dw_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/dw_wdt.c +1 -0
index fef7c61f5555..4a902d015bc2 100644
@@ -135,6 +135,7 @@ static int dw_wdt_start(struct watchdog_device *wdd)
 	struct dw_wdt *dw_wdt = to_dw_wdt(wdd);
 
 	dw_wdt_set_timeout(wdd, wdd->timeout);
+	dw_wdt_ping(&dw_wdt->wdd);
 	dw_wdt_arm_system_reset(dw_wdt);
 
 	return 0;
Signature · 1 line
2.24.1