Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH] rtc: mpc5121: request IRQs after allocating the RTC device
Date: Sun, 04 Oct 2026 22:40:49 +0000	[thread overview]
Message-ID: <20261004224050.057031F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261004222907.437878-1-rosenp@gmail.com>

> Probe requests both IRQs with devm_request_irq() before
> devm_rtc_allocate_device(). Devres releases resources in reverse order,
> so on unbind or probe failure the RTC device is put before the IRQs
> are freed. A handler running in that window passes the stale rtc->rtc
> to rtc_update_irq(), which schedules work on the freed device.
> 
> On unbind, remove() first disables the alarm and update interrupts, so
> only a handler already running on another CPU is affected. On a probe
> failure after the IRQs are requested, remove() does not run, and an
> alarm left pending, for example a wake alarm from before a reboot, can
> fire in that window.
> 
> Request the IRQs after the RTC device is allocated and set up, right
> before registering it, so devres frees them and waits for running
> handlers before releasing the device. An interrupt arriving before
> registration is harmless, as rtc_update_irq() only schedules work on
> an allocated device.
> 
> Fixes: d53d4ae981d0 ("rtc: mpc5121: simplify probe")
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261004222907.437878-1-rosenp@gmail.com?part=1


      reply	other threads:[~2026-10-04 22:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 22:29 [PATCH] rtc: mpc5121: request IRQs after allocating the RTC device Rosen Penev
2026-10-04 22:40 ` sashiko-bot [this message]

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=20261004224050.057031F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=rosenp@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