From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: linux-clk@vger.kernel.org, robh@kernel.org,
devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v13 09/11] clk: realtek: Add RTD1625-CRT clock controller driver
Date: Wed, 12 Aug 2026 02:16:06 +0000 [thread overview]
Message-ID: <20260812021607.34CEF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812020009.3480538-10-eleanor.lin@realtek.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Sleeping in atomic context due to `fsleep()` in `regmap_multi_reg_write()` called under a spinlock.
--
--- Patch [9]: [PATCH v13 09/11] clk: realtek: Add RTD1625-CRT clock controller driver ---
commit 94dc67c9ada3ad3a78ad1cf0f8ae4674b5f69224
Author: Cheng-Yu Lee <cylee12@realtek.com>
clk: realtek: Add RTD1625-CRT clock controller driver
Add support for the CRT (Clock, Reset, and Test) domain clock controller
on the Realtek RTD1625 SoC. This driver provides essential clock sources
(including PLLs), gating, and multiplexing functionalities.
> diff --git a/drivers/clk/realtek/clk-rtd1625-crt.c b/drivers/clk/realtek/clk-rtd1625-crt.c
> new file mode 100644
> index 0000000000000..3da88d3cf0dd2
> --- /dev/null
> +++ b/drivers/clk/realtek/clk-rtd1625-crt.c
[ ... ]
> +static const struct reg_sequence pll_acpu_seq_power_on[] = {
> + {RTD1625_REG_PLL_ACPU2, 0x5},
> + {RTD1625_REG_PLL_ACPU2, 0x7},
> + {RTD1625_REG_PLL_ACPU1, 0x54000},
> + {RTD1625_REG_PLL_SSC_DIG_ACPU2, 0x1e1f8e},
> + {RTD1625_REG_PLL_SSC_DIG_ACPU0, 0x4},
> + {RTD1625_REG_PLL_SSC_DIG_ACPU0, 0x5, 200},
[Severity: High]
Does this 200us delay cause a "scheduling while atomic" bug when enabling the
clock?
Looking at rtk_clk_regmap_pll_enable() in drivers/clk/realtek/clk-pll.c, it
acquires an irq-disabled spinlock before processing this power-on sequence:
spin_lock_irqsave(&clkp->lock, flags);
if (is_power_on(clkp))
goto unlock;
ret = regmap_multi_reg_write(clkp->clkr.regmap, clkp->seq_power_on,
clkp->num_seq_power_on);
When regmap_multi_reg_write() encounters the 200us delay in this sequence,
it calls fsleep(200), which delegates to usleep_range() and sleeps.
Since this is called while holding the spinlock, could it trigger a BUG or
panic? Could the power-on sequence be moved to a .prepare callback which is
allowed to sleep, or perhaps use a custom delay implementation that safely
spins using udelay()?
This also applies to the other power-on sequences introduced in this file
(pll_ve1_seq_power_on, pll_gpu_seq_power_on, pll_npu_seq_power_on,
pll_ve2_seq_power_on, and pll_hifi_seq_power_on).
> + {RTD1625_REG_PLL_ACPU2, 0x3},
> +};
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812020009.3480538-1-eleanor.lin@realtek.com?part=9
next prev parent reply other threads:[~2026-08-12 2:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 1:59 [PATCH v13 00/11] clk / reset: realtek: Add RTD1625 clock and reset support Yu-Chun Lin
2026-08-12 1:59 ` [PATCH v13 01/11] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 02/11] reset: Add Realtek basic reset support Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 03/11] reset: realtek: Add RTD1625 reset controller driver Yu-Chun Lin
2026-08-12 2:10 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 04/11] clk: realtek: Introduce common probe() and remove() Yu-Chun Lin
2026-08-12 2:08 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 05/11] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-08-12 2:11 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 06/11] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 07/11] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 08/11] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-08-12 2:00 ` [PATCH v13 09/11] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-08-12 2:16 ` sashiko-bot [this message]
2026-08-12 2:00 ` [PATCH v13 10/11] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-08-12 2:18 ` sashiko-bot
2026-08-12 2:00 ` [PATCH v13 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=20260812021607.34CEF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eleanor.lin@realtek.com \
--cc=linux-clk@vger.kernel.org \
--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