clk: rockchip: fix finding of maximum clock ID
Subsystems (2)
PATCH 1/1 clk: rockchip: fix finding of maximum clock ID
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
--- drivers/clk/rockchip/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk.c +1 -1
@@ -439,7 +439,7 @@ unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list,if (list->id > max) max = list->id;if (list->child && list->child->id > max) - max = list->id; + max = list->child->id; }return max;
Signature · 1 line
2.46.0
Hi,
Quoted 6 lines · Yao Zi
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
Fixes 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")Signed-off-by Yao Zi <[email protected]>---
oops, good catch. Note, that the function returns the correct value for RK3588, since the clocks with the highest IDs are of GATE_LINK type and do not have their child field set. I have not checked all the Rockchip SoCs converted for 6.12, so I suggest sending this as fixes material for 6.12.
Greetings,
-- Sebastian
Quoted 19 lines
drivers/clk/rockchip/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/rockchip/clk.c +1
-1@@ -439,7 +439,7 @@ unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list,if (list->id > max) max = list->id;if (list->child && list->child->id > max) - max = list->id; + max = list->child->id; }return max;Signature · 1 line
2.46.0
Quoted 10 lines · Sebastian Reichel
Hi,
Quoted 6 lines · Yao Zi
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
Fixes 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")Signed-off-by Yao Zi <[email protected]>---
Quoted 5 lines
Reviewed-by Sebastian Reichel <[email protected]>oops, good catch. Note, that the function returns the correct value for RK3588, since the clocks with the highest IDs are of
GATE_LINKtype and do not have their child field set.
yes, but it does hit me when working for rk3528 clock controller unit.
Quoted 3 lines
I have not checked all
the Rockchip SoCs converted for 6.12, so I suggest sending this as fixes material for 6.12.
I have done a rough check and think no code in 6.11 release is affected.
Quoted 4 lines
Greetings,
-- Sebastian
Cheers,
Yao Zi
Am Donnerstag, 12. September 2024, 15:32:05 CEST schrieb Yao Zi:
Quoted 5 lines
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
Fixes 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")Signed-off-by Yao Zi <[email protected]>
@Stephen: can you put that on top of the other Rockchip changes for 6.12 please?
Thanks a lot
Heiko
Quoted 18 lines
--- drivers/clk/rockchip/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/rockchip/clk.c +1
-1@@ -439,7 +439,7 @@ unsigned long rockchip_clk_find_max_clk_id(struct rockchip_clk_branch *list,if (list->id > max) max = list->id;if (list->child && list->child->id > max) - max = list->id; + max = list->child->id; }return max;
Stephen Boyd
maintainerQuoting Heiko Stübner (2024-09-14 02:57:35)
Quoted 4 lines
Am Donnerstag, 12. September 2024, 15:32:05 CEST schrieb Yao Zi:
Quoted 3 lines
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
Quoted 8 lines
Quoted 2 lines
Fixes 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")Signed-off-by Yao Zi <[email protected]>Reviewed-by Heiko Stuebner <[email protected]>@Stephen: can you put that on top of the other Rockchip changes for 6.12 please?
Sorry I missed this one. I'll put it on clk-fixes.
Quoting Yao Zi (2024-09-12 06:32:05)
Quoted 6 lines
If an ID of a branch's child is greater than current maximum, we should set new maximum to the child's ID, instead of its parent's.
Fixes 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage")Signed-off-by Yao Zi <[email protected]>---
Applied to clk-fixes