Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v10 05/11] clk: realtek: Add support for phase locked loops (PLLs)
Date: Mon, 13 Jul 2026 16:09:54 +0000	[thread overview]
Message-ID: <20260713160954.B66331F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260713155630.3054636-6-eleanor.lin@realtek.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Asymmetry in enable/disable logic permanently bricks PLLs that lack a readable power status register.
- [Low] The header file `freq_table.h` lacks include guards.
--

--- Patch [5]: [PATCH v10 05/11] clk: realtek: Add support for phase locked loops (PLLs) ---
commit 1e05dd1885eded463b663e611cd68c039c2be096
Author: Cheng-Yu Lee <cylee12@realtek.com>
clk: realtek: Add support for phase locked loops (PLLs)

This commit provides a full set of PLL operations for programmable PLLs
and a read-only variant for fixed or hardware-managed PLLs.

> diff --git a/drivers/clk/realtek/clk-pll.c b/drivers/clk/realtek/clk-pll.c
> new file mode 100644
> index 0000000000000..54c284070e47a
> --- /dev/null
> +++ b/drivers/clk/realtek/clk-pll.c
[ ... ]
> @@ -173,20 +173,19 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
>  static int clk_pll_enable(struct clk_hw *hw)
>  {
>  	struct clk_pll *clkp = to_clk_pll(hw);
>  	unsigned long flags;
>  	int ret = 0;
>  
>  	if (!clkp->seq_power_on)
>  		return ret;
>  
>  	spin_lock_irqsave(&clkp->lock, flags);
>  
>  	if (is_power_on(clkp))
>  		goto unlock;

[Severity: High]
If a PLL has power on/off sequences but no readable status register,
is_power_on() unconditionally returns true. Will this cause the enable path
to permanently skip the power-on sequence if the clock was previously
disabled?

When clk_pll_disable() is called, it executes the power-off sequence:

static void clk_pll_disable(struct clk_hw *hw)
{
        ...
        regmap_multi_reg_write(clkp->clkr.regmap, clkp->seq_power_off, ...);
        ...
}

But when clk_pll_enable() is subsequently called, is_power_on() returns true
because power_reg is 0. Does this cause the power-on sequence to be skipped,
leaving the PLL permanently disabled despite the clock core believing it is
enabled?

> +
> +	ret = regmap_multi_reg_write(clkp->clkr.regmap, clkp->seq_power_on,
> +				     clkp->num_seq_power_on);
> +	if (ret)
> +		goto unlock;
[ ... ]
> diff --git a/drivers/clk/realtek/freq_table.h b/drivers/clk/realtek/freq_table.h
> new file mode 100644
> index 0000000000000..78215aee33007
> --- /dev/null
> +++ b/drivers/clk/realtek/freq_table.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +struct freq_table {

[Severity: Low]
Is it intentional to omit the standard include guards here? If this header
is included multiple times in the future, could it lead to redefinition
errors for struct freq_table?

> +	u32 val;
> +	unsigned long rate;
> +};

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260713155630.3054636-1-eleanor.lin@realtek.com?part=5

  reply	other threads:[~2026-07-13 16:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 15:56 [PATCH v10 00/11] clk / reset: realtek: Add RTD1625 clock and reset support Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 01/11] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 02/11] reset: Add Realtek basic reset support Yu-Chun Lin
2026-07-13 16:08   ` sashiko-bot
2026-07-13 15:56 ` [PATCH v10 03/11] reset: realtek: Add RTD1625 reset controller driver Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 04/11] clk: realtek: Introduce a common probe() Yu-Chun Lin
2026-07-13 16:15   ` sashiko-bot
2026-07-13 15:56 ` [PATCH v10 05/11] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-07-13 16:09   ` sashiko-bot [this message]
2026-07-13 15:56 ` [PATCH v10 06/11] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 07/11] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 08/11] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-07-13 16:30   ` sashiko-bot
2026-07-13 15:56 ` [PATCH v10 09/11] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-07-13 15:56 ` [PATCH v10 10/11] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-07-13 16:25   ` sashiko-bot
2026-07-13 15:56 ` [PATCH v10 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=20260713160954.B66331F000E9@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