From dec56fe0c045353ee311580ccb054507ec58e19e Mon Sep 17 00:00:00 2001 From: Mike Tipton Date: Fri, 25 Jun 2021 05:55:36 -0700 Subject: [PATCH] clk: qcom: Round parent rate in clk_rcg2_determine_rate We currently set best_parent_rate to the ideal frequency wanted by the RCG. This doesn't always align to the exact frequency the parent can provide. If they differ, then clk_calc_new_rates() will return the parent as top, even if the rounded parent frequency isn't changing. This causes clk_propagate_rate_change() to return before being called for its children, which means children aren't notified of the PRE_RATE_CHANGE events. Set best_parent_rate to the rounded rate so that we don't unnecessarily try to change the parent. Change-Id: Ic976db7a13dfbc63cb66b032a45060565ca90b43 Signed-off-by: Mike Tipton --- drivers/clk/qcom/clk-rcg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 7f116b064013..2f9d97d0c91f 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -359,7 +359,7 @@ static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f, rate = clk_hw_get_rate(p); } req->best_parent_hw = p; - req->best_parent_rate = rate; + req->best_parent_rate = clk_hw_round_rate(p, rate); req->rate = f->freq; if (f->src_freq != FIXED_FREQ_SRC) {