mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()
@ 2026-09-18 15:54 Cong Nguyen
  2026-09-18 19:46 ` Frank Li
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Nguyen @ 2026-09-18 15:54 UTC (permalink / raw)
  To: Frank Li
  Cc: Alexandre Belloni, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, linux-rtc, imx, linux-arm-kernel, linux-kernel

dev_pm_set_wake_irq() in probe has no matching dev_pm_clear_wake_irq()
anywhere -- not on later probe-failure paths, not in remove(). Switch
to devm_pm_set_wake_irq(), which registers the clear automatically on
every exit path.

Fixes: fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260914134826.EC26D1F000FF@smtp.kernel.org
Assisted-by: LLM
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/rtc/rtc-mxc_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index a07acbbcfaeb..7080aaf9ffa0 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
 		return pdata->irq;
 
 	device_init_wakeup(&pdev->dev, true);
-	ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
+	ret = devm_pm_set_wake_irq(&pdev->dev, pdata->irq);
 	if (ret)
 		dev_err(&pdev->dev, "failed to enable irq wake\n");
 
-- 
2.25.1


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

* Re: [PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()
  2026-09-18 15:54 [PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove() Cong Nguyen
@ 2026-09-18 19:46 ` Frank Li
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-09-18 19:46 UTC (permalink / raw)
  To: Cong Nguyen
  Cc: Frank Li, Alexandre Belloni, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, linux-rtc, imx,
	linux-arm-kernel, linux-kernel

On Fri, Sep 18, 2026 at 10:54:29PM +0700, Cong Nguyen wrote:
> [You don't often get email from congnt264@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> dev_pm_set_wake_irq() in probe has no matching dev_pm_clear_wake_irq()
> anywhere -- not on later probe-failure paths, not in remove(). Switch
> to devm_pm_set_wake_irq(), which registers the clear automatically on
> every exit path.
>
> Fixes: fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
> Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
> Link: https://lore.kernel.org/r/20260914134826.EC26D1F000FF@smtp.kernel.org
> Assisted-by: LLM
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/rtc/rtc-mxc_v2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
> index a07acbbcfaeb..7080aaf9ffa0 100644
> --- a/drivers/rtc/rtc-mxc_v2.c
> +++ b/drivers/rtc/rtc-mxc_v2.c
> @@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
>                 return pdata->irq;
>
>         device_init_wakeup(&pdev->dev, true);
> -       ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
> +       ret = devm_pm_set_wake_irq(&pdev->dev, pdata->irq);
>         if (ret)
>                 dev_err(&pdev->dev, "failed to enable irq wake\n");
>
> --
> 2.25.1
>
>

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

end of thread, other threads:[~2026-09-18 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 15:54 [PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove() Cong Nguyen
2026-09-18 19:46 ` Frank Li

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®