Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Prasanth R" <ragaprasanth@gmail.com>, linux-rtc@vger.kernel.org
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH 04/12] rtc: mxc_v2: clear the wake IRQ on unbind
Date: Wed, 25 Nov 2026 07:25:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-232779@kernel.org> (raw)
In-Reply-To: <20261125072026.2997493-5-prasanth.r@lineo.co.jp>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] rtc: mxc_v2: unhandled interrupt storm in mxc_rtc_remove() [1]
--

commit f8f7168b7242f3f7ce38e7545b8decc669f9b81a
Author: Prasanth R <ragaprasanth@gmail.com>

rtc: mxc_v2: clear the wake IRQ on unbind

This commit replaces device_init_wakeup() and dev_pm_set_wake_irq() with
their device-managed variants in mxc_rtc_probe() so the wakeup source and
wake IRQ are released on unbind.

> diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
> index 35a18b75c1098..fe3a55b00418b 100644
> --- a/drivers/rtc/rtc-mxc_v2.c
> +++ b/drivers/rtc/rtc-mxc_v2.c
> @@ -301,8 +301,8 @@ static int mxc_rtc_probe(struct platform_device *pdev)
>  	if (pdata->irq < 0)
>  		return pdata->irq;
>  
> -	device_init_wakeup(&pdev->dev, true);
> -	ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
> +	devm_device_init_wakeup(&pdev->dev);
> +	ret = devm_pm_set_wake_irq(&pdev->dev, pdata->irq);
>  	if (ret)
>  		dev_err(&pdev->dev, "failed to enable irq wake\n");
>  

[Severity: High]
This problem wasn't introduced by this patch, but can unbinding the driver
while a hardware alarm is armed trigger an unhandled interrupt storm
[1]?

drivers/rtc/rtc-mxc_v2.c:mxc_rtc_remove() {
	struct mxc_rtc_data *pdata = platform_get_drvdata(pdev);

	clk_unprepare(pdata->clk);
}

mxc_rtc_remove() does not clear SRTC_LPCR_ALP or SRTC_LPCR_WAE before
devres unregisters the IRQ handler.  If a pending alarm fires afterward,
no handler is left to acknowledge it and the IRQ core disables the line
with "nobody cared".

[1] https://sashiko.dev/#/bug/linux-4a7ad9ff-00aa-4c3f-aa57-966cdc8a71a1

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125072026.2997493-1-prasanth.r@lineo.co.jp?part=4

  reply	other threads:[~2026-11-25  7:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  7:20 [PATCH 00/12] rtc: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:20 ` [PATCH 01/12] rtc: snvs: " Prasanth R
2026-11-25  7:20 ` [PATCH 02/12] rtc: mxc: " Prasanth R
2026-11-25  7:20 ` [PATCH 03/12] rtc: mxc_v2: fix unbalanced clock disable on remove Prasanth R
2026-11-25  7:20 ` [PATCH 04/12] rtc: mxc_v2: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:25   ` sashiko-bot [this message]
2026-11-25  7:20 ` [PATCH 05/12] rtc: imxdi: clear the wake IRQ on removal Prasanth R
2026-11-25  7:20 ` [PATCH 06/12] rtc: da9063: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:20 ` [PATCH 07/12] rtc: fsl-ftm-alarm: " Prasanth R
2026-11-25  7:20 ` [PATCH 08/12] rtc: jz4740: " Prasanth R
2026-11-25  7:20 ` [PATCH 09/12] rtc: atcrtc100: " Prasanth R
2026-11-25  7:20 ` [PATCH 10/12] rtc: pcf8523: " Prasanth R
2026-11-25  7:33   ` sashiko-bot
2026-11-25  7:20 ` [PATCH 11/12] rtc: pcf85063: " Prasanth R
2026-11-25  7:29   ` sashiko-bot
2026-11-25  7:20 ` [PATCH 12/12] rtc: rv8803: " Prasanth R
2026-11-25  7:32   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-232779@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-rtc@vger.kernel.org \
    --cc=ragaprasanth@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox