]> git.baikalelectronics.ru Git - kernel.git/commit
clk: qcom: clk-rcg2: fix gfx3d frequency calculation
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 19 Apr 2022 23:54:47 +0000 (02:54 +0300)
committerStephen Boyd <sboyd@kernel.org>
Fri, 22 Apr 2022 02:49:19 +0000 (19:49 -0700)
commitda155c98e0f6c41db658dcb16788d89ffad82a12
tree21dae89f79a41527a0d4722cd4a9de58027132c9
parent86ac57e3f6d9de4392cc69c6211f03ef08eb3b0a
clk: qcom: clk-rcg2: fix gfx3d frequency calculation

Since the commit 1959d39d2f7f ("clk: Always clamp the rounded rate"),
the clk_core_determine_round_nolock() would clamp the requested rate
between min and max rates from the rate request. Normally these fields
would be filled by clk_core_get_boundaries() called from
clk_round_rate().

However clk_gfx3d_determine_rate() uses a manually crafted rate request,
which did not have these fields filled. Thus the requested frequency
would be clamped to 0, resulting in weird frequencies being requested
from the hardware.

Fix this by filling min_rate and max_rate to the values valid for the
respective PLLs (0 and ULONG_MAX).

Fixes: 1959d39d2f7f ("clk: Always clamp the rounded rate")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220419235447.1586192-1-dmitry.baryshkov@linaro.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reported-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/qcom/clk-rcg2.c