Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] watchdog: dw_wdt: ping watchdog to reset countdown before start
@ 2020-01-07 15:51 Jack Mitchell
  2020-01-07 18:26 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Mitchell @ 2020-01-07 15:51 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: ml, Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel

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.

Signed-off-by: Jack Mitchell <ml@embed.me.uk>
---
 drivers/watchdog/dw_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index fef7c61f5555..4a902d015bc2 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -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;
-- 
2.24.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] watchdog: dw_wdt: ping watchdog to reset countdown before start
  2020-01-07 15:51 [PATCH v2] watchdog: dw_wdt: ping watchdog to reset countdown before start Jack Mitchell
@ 2020-01-07 18:26 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2020-01-07 18:26 UTC (permalink / raw)
  To: Jack Mitchell; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

On Tue, Jan 07, 2020 at 03:51:55PM +0000, Jack Mitchell wrote:
> 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.
> 
> Signed-off-by: Jack Mitchell <ml@embed.me.uk>

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,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/dw_wdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
> index fef7c61f5555..4a902d015bc2 100644
> --- a/drivers/watchdog/dw_wdt.c
> +++ b/drivers/watchdog/dw_wdt.c
> @@ -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;
> -- 
> 2.24.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 15:51 [PATCH v2] watchdog: dw_wdt: ping watchdog to reset countdown before start Jack Mitchell
2020-01-07 18:26 ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git