mirror of https://lore.kernel.org/lkml/
 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	[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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®