From: Steffen Trumtrar <redacted>
The only way of stopping the watchdog is by resetting it.
Add the watchdog op for stopping the device and reset if
a reset line is provided.
Signed-off-by: Steffen Trumtrar <redacted>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Wim Van Sebroeck <redacted>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog at vger.kernel.org
---
drivers/watchdog/dw_wdt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -135,6 +135,21 @@ static int dw_wdt_start(struct watchdog_device *wdd)return0;}+staticintdw_wdt_stop(structwatchdog_device*wdd)+{+structdw_wdt*dw_wdt=to_dw_wdt(wdd);++if(IS_ERR(dw_wdt->rst)){+dev_warn(wdd->parent,"No reset line. Will not stop.\n");+returnPTR_ERR(dw_wdt->rst);+}++reset_control_assert(dw_wdt->rst);+reset_control_deassert(dw_wdt->rst);++return0;+}+staticintdw_wdt_restart(structwatchdog_device*wdd,unsignedlongaction,void*data){
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2017-09-14 10:18:25
Hi Oleksij,
On Thu, 2017-09-14 at 10:14 +0200, Oleksij Rempel wrote:
quoted hunk
From: Steffen Trumtrar <redacted>
The only way of stopping the watchdog is by resetting it.
Add the watchdog op for stopping the device and reset if
a reset line is provided.
Signed-off-by: Steffen Trumtrar <redacted>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Wim Van Sebroeck <redacted>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog at vger.kernel.org
---
?drivers/watchdog/dw_wdt.c | 16 ++++++++++++++++
?1 file changed, 16 insertions(+)
if (!dw_wdt->rst) {
Since commit 65a3b6935d92 ("watchdog: dw_wdt: get reset lines from dt"),
the reset control is requested as optional, meaning dw_wdt->rst == NULL
if the reset line is not present. If an error is value is stored into
dw_wdt->rst, the probe function does not succeed.
+ dev_warn(wdd->parent, "No reset line. Will not
stop.\n");
+ return PTR_ERR(dw_wdt->rst);
+ }
On Thu, Sep 14, 2017 at 10:14:01AM +0200, Oleksij Rempel wrote:
quoted hunk
From: Steffen Trumtrar <redacted>
The only way of stopping the watchdog is by resetting it.
Add the watchdog op for stopping the device and reset if
a reset line is provided.
Signed-off-by: Steffen Trumtrar <redacted>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Wim Van Sebroeck <redacted>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog at vger.kernel.org
---
drivers/watchdog/dw_wdt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -135,6 +135,21 @@ static int dw_wdt_start(struct watchdog_device *wdd)return0;}+staticintdw_wdt_stop(structwatchdog_device*wdd)+{+structdw_wdt*dw_wdt=to_dw_wdt(wdd);++if(IS_ERR(dw_wdt->rst)){+dev_warn(wdd->parent,"No reset line. Will not stop.\n");+returnPTR_ERR(dw_wdt->rst);+}
This is a change in behavior. Previously, with no stop function,
the watchdog core would keep pinging the watchdog in this situation.
Now it would end up spitting a warning and resetting the system.