diff mbox series

[1/1] clk: composite: Fix 'switching' to same clock

Message ID 20211103122441.3208576-1-alexander.stein@ew.tq-group.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/1] clk: composite: Fix 'switching' to same clock | expand

Commit Message

Alexander Stein Nov. 3, 2021, 12:24 p.m. UTC
During commit 6594988fd625 ("clk: composite: Use rate_ops.determine_rate
when also a mux is available") setting req->best_parent_hw got lost,
so best_parent_hw stays NULL during switch to the same parent. This
results in the (debug) message:
  clk_calc_new_rates: lcdif_pixel not gated but wants to reparent
and the following rate change is dropped.

Fixes: 6594988fd625 ("clk: composite: Use rate_ops.determine_rate when also a mux is available")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
This is on linux-next tag 'next-20211101' and platform is a custom
imx8mq board.

 drivers/clk/clk-composite.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin Blumenstingl Nov. 3, 2021, 9:13 p.m. UTC | #1
Hi Alexander,

On Wed, Nov 3, 2021 at 1:24 PM Alexander Stein
<alexander.stein@ew.tq-group.com> wrote:
>
> During commit 6594988fd625 ("clk: composite: Use rate_ops.determine_rate
> when also a mux is available") setting req->best_parent_hw got lost,
> so best_parent_hw stays NULL during switch to the same parent. This
> results in the (debug) message:
>   clk_calc_new_rates: lcdif_pixel not gated but wants to reparent
> and the following rate change is dropped.
Thanks for investigating and fixing this!

note to myself: only clocks with CLK_SET_RATE_NO_REPARENT are affected.
This might be the reason why it wasn't spotted on Rockchip SoCs (yet).
I have Cc'ed Alex and Chen-Yu in case they're investigating breakage
on Rockchip SoCs with linux-next

> Fixes: 6594988fd625 ("clk: composite: Use rate_ops.determine_rate when also a mux is available")
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>


Best regards,
Martin
Stephen Boyd Nov. 4, 2021, 12:50 a.m. UTC | #2
Quoting Alexander Stein (2021-11-03 05:24:41)
> During commit 6594988fd625 ("clk: composite: Use rate_ops.determine_rate
> when also a mux is available") setting req->best_parent_hw got lost,
> so best_parent_hw stays NULL during switch to the same parent. This
> results in the (debug) message:
>   clk_calc_new_rates: lcdif_pixel not gated but wants to reparent
> and the following rate change is dropped.
> 
> Fixes: 6594988fd625 ("clk: composite: Use rate_ops.determine_rate when also a mux is available")
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index c04ae0e7e4b4..b9c5f904f535 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -97,6 +97,7 @@  static int clk_composite_determine_rate(struct clk_hw *hw,
 				return ret;
 
 			req->rate = tmp_req.rate;
+			req->best_parent_hw = tmp_req.best_parent_hw;
 			req->best_parent_rate = tmp_req.best_parent_rate;
 
 			return 0;