[PATCH RFC RFT v3 07/13] clk: meson: gxbb: Model the PLL pre-divider as a divider clock

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Dec 1 01:16:56 PST 2026


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 at 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



More information about the linux-amlogic mailing list