All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: sp805: disable watchdog on remove
@ 2022-04-03  5:22 Eliav Farber
  2022-04-03  5:41 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Eliav Farber @ 2022-04-03  5:22 UTC (permalink / raw)
  To: wim, linux, linux-watchdog, linux-kernel
  Cc: ronenk, talel, hhhawa, jonnyc, hanochu, farbere, dwmw

Disable the watchdog if it is active while removing the module.
It is necessary in order to prevent a reset in case watchdog
hw was running before the removal.

Signed-off-by: Eliav Farber <farbere@amazon.com>
---
 drivers/watchdog/sp805_wdt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index d8876fba686d..d7dc0f3f16ec 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -311,6 +311,9 @@ static int sp805_wdt_remove(struct amba_device *adev)
 {
 	struct sp805_wdt *wdt = amba_get_drvdata(adev);
 
+	if (watchdog_active(&wdt->wdd))
+		wdt_disable(&wdt->wdd);
+
 	watchdog_unregister_device(&wdt->wdd);
 	watchdog_set_drvdata(&wdt->wdd, NULL);
 
-- 
2.32.0


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

* Re: [PATCH] watchdog: sp805: disable watchdog on remove
  2022-04-03  5:22 [PATCH] watchdog: sp805: disable watchdog on remove Eliav Farber
@ 2022-04-03  5:41 ` Guenter Roeck
  2022-04-14  5:27   ` [UNVERIFIED SENDER] " Farber, Eliav
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2022-04-03  5:41 UTC (permalink / raw)
  To: Eliav Farber, wim, linux-watchdog, linux-kernel
  Cc: ronenk, talel, hhhawa, jonnyc, hanochu, dwmw

On 4/2/22 22:22, Eliav Farber wrote:
> Disable the watchdog if it is active while removing the module.
> It is necessary in order to prevent a reset in case watchdog
> hw was running before the removal.
> 
> Signed-off-by: Eliav Farber <farbere@amazon.com>
> ---
>   drivers/watchdog/sp805_wdt.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index d8876fba686d..d7dc0f3f16ec 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -311,6 +311,9 @@ static int sp805_wdt_remove(struct amba_device *adev)
>   {
>   	struct sp805_wdt *wdt = amba_get_drvdata(adev);
>   
> +	if (watchdog_active(&wdt->wdd))
> +		wdt_disable(&wdt->wdd);
> +

Why not use watchdog_stop_on_unregister() ?

Guenter

>   	watchdog_unregister_device(&wdt->wdd);
>   	watchdog_set_drvdata(&wdt->wdd, NULL);
>   


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

* Re: [UNVERIFIED SENDER] Re: [PATCH] watchdog: sp805: disable watchdog on remove
  2022-04-03  5:41 ` Guenter Roeck
@ 2022-04-14  5:27   ` Farber, Eliav
  0 siblings, 0 replies; 3+ messages in thread
From: Farber, Eliav @ 2022-04-14  5:27 UTC (permalink / raw)
  To: Guenter Roeck, wim, linux-watchdog, linux-kernel
  Cc: ronenk, talel, hhhawa, jonnyc, hanochu, dwmw

On 4/3/2022 8:41 AM, Guenter Roeck wrote:
> Why not use watchdog_stop_on_unregister() ? 

I'll use watchdog_stop_on_unregister() instead of my change.


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

end of thread, other threads:[~2022-04-14  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03  5:22 [PATCH] watchdog: sp805: disable watchdog on remove Eliav Farber
2022-04-03  5:41 ` Guenter Roeck
2022-04-14  5:27   ` [UNVERIFIED SENDER] " Farber, Eliav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.