Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt
@ 2019-04-10 12:49 Bryan Tan
  2019-04-10 13:38 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Tan @ 2019-04-10 12:49 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel, Bryan Tan

The get_timeleft call for wdat_wdt was using ACPI_WDAT_GET_COUNTDOWN
when running an action on the device, which would return the configured
countdown, instead of ACPI_WDAT_GET_CURRENT_COUNTDOWN, which returns the
time left before the watchdog will fire. This change corrects that.

Signed-off-by: Bryan Tan <bryantan@vmware.com>
---
 drivers/watchdog/wdat_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
index 56ad196..387892f 100644
--- a/drivers/watchdog/wdat_wdt.c
+++ b/drivers/watchdog/wdat_wdt.c
@@ -287,7 +287,7 @@ static unsigned int wdat_wdt_get_timeleft(struct watchdog_device *wdd)
 	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
 	u32 periods = 0;
 
-	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_COUNTDOWN, 0, &periods);
+	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods);
 	return periods * wdat->period / 1000;
 }
 
-- 
2.6.2


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

* Re: [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt
  2019-04-10 12:49 [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt Bryan Tan
@ 2019-04-10 13:38 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-04-10 13:38 UTC (permalink / raw)
  To: Bryan Tan; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel

On 4/10/19 5:49 AM, Bryan Tan wrote:
> The get_timeleft call for wdat_wdt was using ACPI_WDAT_GET_COUNTDOWN
> when running an action on the device, which would return the configured
> countdown, instead of ACPI_WDAT_GET_CURRENT_COUNTDOWN, which returns the
> time left before the watchdog will fire. This change corrects that.
> 
> Signed-off-by: Bryan Tan <bryantan@vmware.com>

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

> ---
>   drivers/watchdog/wdat_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
> index 56ad196..387892f 100644
> --- a/drivers/watchdog/wdat_wdt.c
> +++ b/drivers/watchdog/wdat_wdt.c
> @@ -287,7 +287,7 @@ static unsigned int wdat_wdt_get_timeleft(struct watchdog_device *wdd)
>   	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
>   	u32 periods = 0;
>   
> -	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_COUNTDOWN, 0, &periods);
> +	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods);
>   	return periods * wdat->period / 1000;
>   }
>   
> 


^ 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 --
2019-04-10 12:49 [PATCH] watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt Bryan Tan
2019-04-10 13:38 ` 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 linux-watchdog@archiver.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