From: Stephen Boyd <sboyd@kernel.org>
To: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Michael Turquette <mturquette@baylibre.com>,
Taniya Das <quic_tdas@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
Rob Clark <robdclark@gmail.com>,
freedreno@lists.freedesktop.org,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Maxime Ripard <maxime@cerno.tech>
Subject: Re: [PATCH] clk: qcom: clk-rcg2: fix gfx3d frequency calculation
Date: Thu, 21 Apr 2022 19:49:12 -0700 [thread overview]
Message-ID: <20220422024914.203CEC385A7@smtp.kernel.org> (raw)
In-Reply-To: <20220419235447.1586192-1-dmitry.baryshkov@linaro.org>
+Maxime
Quoting Dmitry Baryshkov (2022-04-19 16:54:47)
> Since the commit 948fb0969eae ("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: 948fb0969eae ("clk: Always clamp the rounded rate")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
I hope there aren't others like this lurking.
> 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 f675fd969c4d..e9c357309fd9 100644
> --- a/drivers/clk/qcom/clk-rcg2.c
> +++ b/drivers/clk/qcom/clk-rcg2.c
> @@ -818,7 +818,7 @@ EXPORT_SYMBOL_GPL(clk_pixel_ops);
> static int clk_gfx3d_determine_rate(struct clk_hw *hw,
> struct clk_rate_request *req)
> {
> - struct clk_rate_request parent_req = { };
> + struct clk_rate_request parent_req = { .min_rate = 0, .max_rate = ULONG_MAX };
> struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw);
> struct clk_hw *xo, *p0, *p1, *p2;
> unsigned long p0_rate;
next prev parent reply other threads:[~2022-04-22 2:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 23:54 [PATCH] clk: qcom: clk-rcg2: fix gfx3d frequency calculation Dmitry Baryshkov
2022-04-20 2:47 ` Bjorn Andersson
2022-04-20 2:48 ` Bjorn Andersson
2022-04-22 2:49 ` Stephen Boyd [this message]
2022-04-22 9:48 ` Maxime Ripard
2022-04-23 1:56 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220422024914.203CEC385A7@smtp.kernel.org \
--to=sboyd@kernel.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=mturquette@baylibre.com \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_tdas@quicinc.com \
--cc=robdclark@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox