linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [watchdog v2] watchdog: mei_wdt: request stop on unregister
@ 2021-01-24 11:49 Tomas Winkler
  2021-01-24 15:43 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2021-01-24 11:49 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: linux-watchdog, linux-kernel, Alexander Usyskin, stable, Tomas Winkler

From: Alexander Usyskin <alexander.usyskin@intel.com>

The MEI bus has a special behavior on suspend it destroys
all the attached devices, this is due to the fact that also
firmware context is not persistent across power flows.

If watchdog on MEI bus is ticking before suspending the firmware
times out and reports that the OS is missing watchdog tick.
Send the stop command to the firmware on watchdog unregistered
to eliminate the false event on suspend.
This does not make the things worse from the user-space perspective
as a user-space should re-open watchdog device after
suspending before this patch.

Cc: <stable@vger.kernel.org>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
V2: Update the commit message with better explanation

 drivers/watchdog/mei_wdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index 5391bf3e6b11..c5967d8b4256 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -382,6 +382,7 @@ static int mei_wdt_register(struct mei_wdt *wdt)
 
 	watchdog_set_drvdata(&wdt->wdd, wdt);
 	watchdog_stop_on_reboot(&wdt->wdd);
+	watchdog_stop_on_unregister(&wdt->wdd);
 
 	ret = watchdog_register_device(&wdt->wdd);
 	if (ret)
-- 
2.26.2


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

* Re: [watchdog v2] watchdog: mei_wdt: request stop on unregister
  2021-01-24 11:49 [watchdog v2] watchdog: mei_wdt: request stop on unregister Tomas Winkler
@ 2021-01-24 15:43 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-01-24 15:43 UTC (permalink / raw)
  To: Tomas Winkler
  Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel,
	Alexander Usyskin, stable

On Sun, Jan 24, 2021 at 01:49:38PM +0200, Tomas Winkler wrote:
> From: Alexander Usyskin <alexander.usyskin@intel.com>
> 
> The MEI bus has a special behavior on suspend it destroys
> all the attached devices, this is due to the fact that also
> firmware context is not persistent across power flows.
> 
> If watchdog on MEI bus is ticking before suspending the firmware
> times out and reports that the OS is missing watchdog tick.
> Send the stop command to the firmware on watchdog unregistered
> to eliminate the false event on suspend.
> This does not make the things worse from the user-space perspective
> as a user-space should re-open watchdog device after
> suspending before this patch.
> 
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>

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

> ---
> V2: Update the commit message with better explanation
> 
>  drivers/watchdog/mei_wdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
> index 5391bf3e6b11..c5967d8b4256 100644
> --- a/drivers/watchdog/mei_wdt.c
> +++ b/drivers/watchdog/mei_wdt.c
> @@ -382,6 +382,7 @@ static int mei_wdt_register(struct mei_wdt *wdt)
>  
>  	watchdog_set_drvdata(&wdt->wdd, wdt);
>  	watchdog_stop_on_reboot(&wdt->wdd);
> +	watchdog_stop_on_unregister(&wdt->wdd);
>  
>  	ret = watchdog_register_device(&wdt->wdd);
>  	if (ret)
> -- 
> 2.26.2
> 

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

end of thread, other threads:[~2021-01-24 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24 11:49 [watchdog v2] watchdog: mei_wdt: request stop on unregister Tomas Winkler
2021-01-24 15:43 ` 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).