All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: stm32_iwdg: use managed variant of dev_pm_set_wake_irq()
@ 2026-11-16 19:01 Antonio Borneo
  2026-11-16 19:09 ` sashiko-bot
  2026-11-16 20:36 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Antonio Borneo @ 2026-11-16 19:01 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, Maxime Coquelin,
	Alexandre Torgue, Clément Le Goffic, Marek Vasut
  Cc: Antonio Borneo, linux-watchdog, linux-stm32, linux-arm-kernel,
	linux-kernel, Sashiko

On probe failure after stm32_iwdg_irq_init() or on driver unbind,
the struct wake_irq allocated by dev_pm_set_wake_irq() is leaked
and dev->power.wakeirq remains attached to the device.
Any subsequent attempt to re-probe the device hits the
dev->power.wakeirq check in dev_pm_attach_wake_irq(), triggers a
dev_WARN_ONCE() splat, and fails probe with -EEXIST.

Use the managed version devm_pm_set_wake_irq().

This is reported by Sashiko inside the raw log of another commit
that touches the same driver.

Fixes: 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/message/20261116132416.1184447-3-antonio.borneo%40foss.st.com
Link: https://sashiko.dev/#/log/249869
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
---
 drivers/watchdog/stm32_iwdg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
index a8d2db2d3cf8b..f1056f8100cf0 100644
--- a/drivers/watchdog/stm32_iwdg.c
+++ b/drivers/watchdog/stm32_iwdg.c
@@ -298,7 +298,7 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
 		if (ret)
 			return ret;
 
-		ret = dev_pm_set_wake_irq(dev, irq);
+		ret = devm_pm_set_wake_irq(dev, irq);
 		if (ret)
 			return ret;
 	}

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.34.1


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

end of thread, other threads:[~2026-11-16 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 19:01 [PATCH] watchdog: stm32_iwdg: use managed variant of dev_pm_set_wake_irq() Antonio Borneo
2026-11-16 19:09 ` sashiko-bot
2026-11-16 20:36 ` Guenter Roeck

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.