watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt
authorBryan Tan <bryantan@vmware.com>
Wed, 10 Apr 2019 12:49:33 +0000 (12:49 +0000)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 5 May 2019 19:02:30 +0000 (21:02 +0200)
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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/wdat_wdt.c

index 56ad19608a9bed0ae43ffaa87e59c71ee85d104e..387892fe63b4a8ceca01916017a7b217c6a6a5c1 100644 (file)
@@ -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;
 }