All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>
Cc: linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v3 1/4] rtc: pcf85063: use devm_of_clk_add_hw_provider() for clkout
Date: Fri, 28 Aug 2026 16:51:26 +0000	[thread overview]
Message-ID: <20260828165126.592111F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828164445.3907839-2-alexander.sverdlin@siemens.com>

> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> 
> pcf85063_clkout_register_clk() registered the OF clock provider with the
> deprecated of_clk_add_provider() and never removed it, so the provider
> kept pointing at freed data after unbind, leading to a use-after-free the
> next time the device-tree clock was resolved.
> 
> Switch to devm_clk_hw_register() and devm_of_clk_add_hw_provider(): both
> the clock and its OF provider are managed resources now, and the provider
> is torn down before the clock on unbind.
> 
> Register the clock on the parent i2c device instead of the rtc device.
> devm_of_clk_add_hw_provider() must use the parent, which owns the
> of_node, and the clkout_hw it points at lives in the driver data
> allocated on the parent. Tying both to the parent releases them together
> on unbind, before the driver data is freed, and keeps their teardown
> ordering guaranteed by a single devres list. Registering the clock on the
> rtc device instead could defer its unregistration past unbind (e.g. while
> a /dev/rtcN fd is open), after clkout_hw has already been freed.
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>

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

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260828164445.3907839-1-alexander.sverdlin@siemens.com?part=1


  reply	other threads:[~2026-08-28 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 16:44 [PATCH v3 0/4] rtc: pcf85063: Update interrupt support A. Sverdlin
2026-08-28 16:44 ` [PATCH v3 1/4] rtc: pcf85063: use devm_of_clk_add_hw_provider() for clkout A. Sverdlin
2026-08-28 16:51   ` sashiko-bot [this message]
2026-08-28 16:44 ` [PATCH v3 2/4] rtc: pcf85063: do not clear AIE in the interrupt handler A. Sverdlin
2026-08-28 17:05   ` sashiko-bot
2026-08-28 16:44 ` [PATCH v3 3/4] rtc: pcf85063: preserve the alarm flag in clkout register updates A. Sverdlin
2026-08-28 16:58   ` sashiko-bot
2026-08-28 17:21     ` Sverdlin, Alexander
2026-08-28 16:44 ` [PATCH v3 4/4] rtc: pcf85063: add 1 Hz update interrupt (UIE) support A. Sverdlin
2026-08-28 17:00   ` 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=20260828165126.592111F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexander.sverdlin@siemens.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    --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 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.