From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v12 10/11] clk: realtek: Add RTD1625-ISO clock controller driver
Date: Tue, 04 Aug 2026 17:05:53 +0000 [thread overview]
Message-ID: <20260804170554.C2AE91F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260804163807.1285869-11-eleanor.lin@realtek.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] The `.suppress_bind_attrs = true` flag was not removed, contradicting the v12 changelog explicitly claiming its removal.
Pre-existing issues:
- [High] Race condition during module teardown leading to NULL pointer dereference in clock operations.
--
--- Patch [10]: [PATCH v12 10/11] clk: realtek: Add RTD1625-ISO clock controller driver ---
commit 5805b8768a6198942f7b7e93baa5ff2d182a3863
Author: Cheng-Yu Lee <cylee12@realtek.com>
clk: realtek: Add RTD1625-ISO clock controller driver
Add support for the ISO (Isolation) domain clock controller on the Realtek
RTD1625 SoC. This controller manages clocks in the always-on power domain,
ensuring essential services remain functional even when the main system
power is gated.
Because the reset controller shares the same register space with this ISO
clock controller, this driver also acts as the parent device and registers
the reset controller as an auxiliary device on the auxiliary bus.
> ---
> Changes in v12:
> - Replace of_device_get_match_data() with device_get_match_data().
> - Use module_platform_driver().
> - Add spaces near {}.
> - Remove .suppress_bind_attrs and add .remove callback.
[Severity: Medium]
This isn't a bug, but the v12 changelog mentions removing
.suppress_bind_attrs, yet it is still present in the driver definition below.
Was this accidentally left in during a rebase?
[ ... ]
> diff --git a/drivers/clk/realtek/clk-rtd1625-iso.c b/drivers/clk/realtek/clk-rtd1625-iso.c
> new file mode 100644
> index 0000000000000..6025c148adf83
> --- /dev/null
> +++ b/drivers/clk/realtek/clk-rtd1625-iso.c
> @@ -0,0 +1,142 @@
[ ... ]
> +static struct platform_driver rtd1625_iso_driver = {
> + .probe = rtd1625_iso_probe,
> + .remove = rtk_clk_remove,
[Severity: High]
This is a pre-existing issue, but does setting the .remove callback here
expose a race condition leading to a NULL pointer dereference during module
unload?
In rtk_clk_probe(), clocks are registered using devm_clk_hw_register(),
meaning they are not deregistered from the Common Clock Framework until after
the .remove callback completes.
However, rtk_clk_remove() manually clears the regmap pointer before devres
has a chance to deregister the clocks:
drivers/clk/realtek/clk-rtk-common.c:rtk_clk_remove() {
...
for (int i = 0; i < desc->num_clks; i++)
desc->clks[i]->regmap = NULL;
...
}
If a concurrent operation (like reading /sys/kernel/debug/clk/clk_summary or
a consumer calling clk_enable) accesses the clock ops during this window,
would it dereference the NULL regmap pointer inside regmap_read()?
> + .driver = {
> + .name = "rtk-rtd1625-iso-clk",
> + .of_match_table = rtd1625_iso_match,
> + .suppress_bind_attrs = true,
> + },
> +};
> +
> +module_platform_driver(rtd1625_iso_driver);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260804163807.1285869-1-eleanor.lin@realtek.com?part=10
next prev parent reply other threads:[~2026-08-04 17:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 16:37 [PATCH v12 00/11] clk / reset: realtek: Add RTD1625 clock and reset support Yu-Chun Lin
2026-08-04 16:37 ` [PATCH v12 01/11] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-08-04 16:37 ` [PATCH v12 02/11] reset: Add Realtek basic reset support Yu-Chun Lin
2026-08-04 16:37 ` [PATCH v12 03/11] reset: realtek: Add RTD1625 reset controller driver Yu-Chun Lin
2026-08-04 16:38 ` [PATCH v12 04/11] clk: realtek: Introduce common probe() and remove() Yu-Chun Lin
2026-08-04 16:54 ` sashiko-bot
2026-08-04 16:38 ` [PATCH v12 05/11] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-08-04 16:38 ` [PATCH v12 06/11] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-08-04 16:38 ` [PATCH v12 07/11] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-08-04 16:38 ` [PATCH v12 08/11] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-08-04 16:38 ` [PATCH v12 09/11] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-08-04 17:12 ` sashiko-bot
2026-08-04 16:38 ` [PATCH v12 10/11] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-08-04 17:05 ` sashiko-bot [this message]
2026-08-04 16:38 ` [PATCH v12 11/11] arm64: dts: realtek: Add clock support for RTD1625 Yu-Chun Lin
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=20260804170554.C2AE91F00AC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eleanor.lin@realtek.com \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox