Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jian Hu" <jian.hu@amlogic.com>
Cc: linux-clk@vger.kernel.org, linux-amlogic@lists.infradead.org,
	devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	neil.armstrong@linaro.org
Subject: Re: [PATCH RFC RFT v3 07/13] clk: meson: gxbb: Model the PLL pre-divider as a divider clock
Date: Tue, 01 Dec 2026 09:16:56 +0000	[thread overview]
Message-ID: <sashiko-outbox-242942@kernel.org> (raw)
In-Reply-To: <20261201-meson_refactor_n-v3-7-f85a4460fd80@amlogic.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] clk: meson: gxbb: accidental revert of gxbb_cts_encp_sel mux
  shift to 20
- [Medium] clk: meson: gxbb: missing zero-divisor flag on gxbb and gxl
  hdmi_prediv
--

commit 3ea24038e4185d59261a086515637e35e0fcb1ea
Author: Jian Hu <jian.hu@amlogic.com>

clk: meson: gxbb: Model the PLL pre-divider as a divider clock

This commit models the GXBB and GXL PLL pre-dividers as separate divider
clocks parenting the DCOs and replaces the GP0 PLL parameter tables with
multiplier ranges.

> diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
> index 2d5128c0bf9e6..b7350788b73ed 100644
> --- a/drivers/clk/meson/gxbb.c
> +++ b/drivers/clk/meson/gxbb.c
[ ... ]
> @@ -192,6 +210,28 @@ static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult = {
>  	},
>  };
>  
> +static struct clk_regmap gxbb_hdmi_prediv = {
> +	.data = &(struct clk_regmap_div_data){
> +		.offset = HHI_HDMI_PLL_CNTL,
> +		.shift	= 9,
> +		.width	= 5,
> +		.flags	= CLK_DIVIDER_ONE_BASED,
> +	},
> +	.hw.init = &(struct clk_init_data){
> +		.name = "hdmi_prediv",
> +		.ops = &clk_regmap_divider_ro_ops,
> +		.parent_hws = (const struct clk_hw *[]) {
> +			&gxbb_hdmi_pll_pre_mult.hw
> +		},
> +		.num_parents = 1,
> +		/*
> +		 * Display directly handle hdmi pll registers ATM, we need
> +		 * NOCACHE to keep our view of the clock as accurate as possible
> +		 */
> +		.flags = CLK_GET_RATE_NOCACHE,
> +	},
> +};
[ ... ]
> @@ -229,7 +264,29 @@ static struct clk_regmap gxbb_hdmi_pll_dco = {
>  		.name = "hdmi_pll_dco",
>  		.ops = &meson_clk_pll_ro_ops,
>  		.parent_hws = (const struct clk_hw *[]) {
> -			&gxbb_hdmi_pll_pre_mult.hw
> +			&gxbb_hdmi_prediv.hw
> +		},
> +		.num_parents = 1,
> +		/*
> +		 * Display directly handle hdmi pll registers ATM, we need
> +		 * NOCACHE to keep our view of the clock as accurate as possible
> +		 */
> +		.flags = CLK_GET_RATE_NOCACHE,
> +	},
> +};
> +
> +static struct clk_regmap gxl_hdmi_prediv = {
> +	.data = &(struct clk_regmap_div_data){
> +		.offset = HHI_HDMI_PLL_CNTL,
> +		.shift	= 9,
> +		.width	= 5,
> +		.flags	= CLK_DIVIDER_ONE_BASED,
> +	},

[Severity: Medium]
Should gxbb_hdmi_prediv and gxl_hdmi_prediv also set
CLK_DIVIDER_INVALID_ZERO?

Previously, meson_clk_pll_recalc_rate() returned 0 when the pre-divider n
field read 0.  With only CLK_DIVIDER_ONE_BASED, if HHI_HDMI_PLL_CNTL[13:9]
is 0 at boot before the display driver initializes the HDMI PLL,
divider_recalc_rate() triggers a WARN() during clock registration and
returns the parent rate instead of 0 Hz.

[ ... ]

> @@ -2371,7 +2419,7 @@ static struct clk_regmap gxbb_cts_encp_sel = {
>  	.data = &(struct clk_regmap_mux_data){
>  		.offset = HHI_VID_CLK_DIV,
>  		.mask = 0xf,
> -		.shift = 24,
> +		.shift = 20,
>  		.table = gxbb_cts_parents_val_table,
>  	},
>  	.hw.init = &(struct clk_init_data){

[Severity: High]
Was this change to gxbb_cts_encp_sel.data.shift accidental?

It reverts ebffd9ffac2c ("clk: meson: gxbb: fix ENCP clock selection"),
causing cts_encp_sel to access the ENCT clock selector at bits [23:20] of
HHI_VID_CLK_DIV instead of the ENCP clock selector at bits [27:24].

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-meson_refactor_n-v3-0-f85a4460fd80@amlogic.com?part=7

  reply	other threads:[~2026-12-01  9:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  8:56 [PATCH RFC RFT v3 00/13] clk: meson: Refactor PLL pre-divider as a divider clock Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 01/13] clk: divider: Add CLK_DIVIDER_INVALID_ZERO flag Jian Hu via B4 Relay
2026-12-01  9:10   ` sashiko-bot
2026-12-01  8:56 ` [PATCH RFC RFT v3 02/13] clk: meson: clk-regmap: Widen the divider flags to 16 bits Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 03/13] dt-bindings: clock: amlogic: Add PLL pre-divider clock IDs Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 04/13] clk: meson: axg: Model the PLL pre-divider as a divider clock Jian Hu via B4 Relay
2026-12-01  9:11   ` sashiko-bot
2026-12-01  8:56 ` [PATCH RFC RFT v3 05/13] clk: meson: a1: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 06/13] clk: meson: c3: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 07/13] clk: meson: gxbb: " Jian Hu via B4 Relay
2026-12-01  9:16   ` sashiko-bot [this message]
2026-12-01  8:56 ` [PATCH RFC RFT v3 08/13] clk: meson: g12a: " Jian Hu via B4 Relay
2026-12-01  9:19   ` sashiko-bot
2026-12-01  8:56 ` [PATCH RFC RFT v3 09/13] clk: meson: meson8: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 10/13] clk: meson: s4: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 11/13] clk: meson: s7: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 12/13] clk: meson: t7: " Jian Hu via B4 Relay
2026-12-01  8:56 ` [PATCH RFC RFT v3 13/13] clk: meson: pll: Remove the dedicated n parameter Jian Hu via B4 Relay
2026-12-01  9:28   ` 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=sashiko-outbox-242942@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jian.hu@amlogic.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=neil.armstrong@linaro.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