linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] watchdog: sp5100_tco: Immediately trigger upon starting.
@ 2023-03-16 20:13 Gregory Oakes
  2023-03-16 23:08 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Oakes @ 2023-03-16 20:13 UTC (permalink / raw)
  To: linux-watchdog; +Cc: terry.bowman, Gregory Oakes

The watchdog countdown is supposed to begin when the device file is
opened. Instead, it would begin countdown upon the first write to or
close of the device file. Now, the ping operation is called within the
start operation which ensures the countdown begins. From experimenation,
it does not appear possible to do this with a single write including
both the start bit and the trigger bit. So, it is done as two distinct
writes.

Signed-off-by: Gregory Oakes <gregory.oakes@amd.com>
---
 drivers/watchdog/sp5100_tco.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
index fb426b7d81da..14f8d8d90920 100644
--- a/drivers/watchdog/sp5100_tco.c
+++ b/drivers/watchdog/sp5100_tco.c
@@ -115,6 +115,10 @@ static int tco_timer_start(struct watchdog_device *wdd)
 	val |= SP5100_WDT_START_STOP_BIT;
 	writel(val, SP5100_WDT_CONTROL(tco->tcobase));
 
+	/* This must be a distinct write. */
+	val |= SP5100_WDT_TRIGGER_BIT;
+	writel(val, SP5100_WDT_CONTROL(tco->tcobase));
+
 	return 0;
 }
 
-- 
2.39.1


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

* Re: [PATCH v2] watchdog: sp5100_tco: Immediately trigger upon starting.
  2023-03-16 20:13 [PATCH v2] watchdog: sp5100_tco: Immediately trigger upon starting Gregory Oakes
@ 2023-03-16 23:08 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2023-03-16 23:08 UTC (permalink / raw)
  To: Gregory Oakes; +Cc: linux-watchdog, terry.bowman

On Thu, Mar 16, 2023 at 03:13:12PM -0500, Gregory Oakes wrote:
> The watchdog countdown is supposed to begin when the device file is
> opened. Instead, it would begin countdown upon the first write to or
> close of the device file. Now, the ping operation is called within the
> start operation which ensures the countdown begins. From experimenation,
> it does not appear possible to do this with a single write including
> both the start bit and the trigger bit. So, it is done as two distinct
> writes.
> 
> Signed-off-by: Gregory Oakes <gregory.oakes@amd.com>

In the future, please remember to provide change logs.
Fortunately I still remember v1, so

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

Guenter

> ---
>  drivers/watchdog/sp5100_tco.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
> index fb426b7d81da..14f8d8d90920 100644
> --- a/drivers/watchdog/sp5100_tco.c
> +++ b/drivers/watchdog/sp5100_tco.c
> @@ -115,6 +115,10 @@ static int tco_timer_start(struct watchdog_device *wdd)
>  	val |= SP5100_WDT_START_STOP_BIT;
>  	writel(val, SP5100_WDT_CONTROL(tco->tcobase));
>  
> +	/* This must be a distinct write. */
> +	val |= SP5100_WDT_TRIGGER_BIT;
> +	writel(val, SP5100_WDT_CONTROL(tco->tcobase));
> +
>  	return 0;
>  }
>  
> -- 
> 2.39.1
> 

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

end of thread, other threads:[~2023-03-16 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 20:13 [PATCH v2] watchdog: sp5100_tco: Immediately trigger upon starting Gregory Oakes
2023-03-16 23:08 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).