From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: qcom: gfx3d: add parent to parent request map
Date: Mon, 19 Jan 2026 15:04:05 +0100 [thread overview]
Message-ID: <1f4e300d-b705-4973-bda9-0eb1be6059a3@oss.qualcomm.com> (raw)
In-Reply-To: <20260117-db820-fix-gfx3d-v1-1-0f8894d71d63@oss.qualcomm.com>
On 1/17/26 4:54 AM, Dmitry Baryshkov wrote:
> After commit d228ece36345 ("clk: divider: remove round_rate() in favor
> of determine_rate()") determining GFX3D clock rate crashes, because the
> passed parent map doesn't provide the expected best_parent_hw clock
> (with the roundd_rate path before the offending commit the
> best_parent_hw was ignored).
>
> Set the field in parent_req in addition to setting it in the req,
> fixing the crash.
>
> clk_hw_round_rate (drivers/clk/clk.c:1764) (P)
> clk_divider_bestdiv (drivers/clk/clk-divider.c:336)
> divider_determine_rate (drivers/clk/clk-divider.c:358)
> clk_alpha_pll_postdiv_determine_rate (drivers/clk/qcom/clk-alpha-pll.c:1275)
> clk_core_determine_round_nolock (drivers/clk/clk.c:1606)
> clk_core_round_rate_nolock (drivers/clk/clk.c:1701)
> __clk_determine_rate (drivers/clk/clk.c:1741)
> clk_gfx3d_determine_rate (drivers/clk/qcom/clk-rcg2.c:1268)
> clk_core_determine_round_nolock (drivers/clk/clk.c:1606)
> clk_core_round_rate_nolock (drivers/clk/clk.c:1701)
> clk_core_round_rate_nolock (drivers/clk/clk.c:1710)
> clk_round_rate (drivers/clk/clk.c:1804)
> dev_pm_opp_set_rate (drivers/opp/core.c:1440 (discriminator 1))
> msm_devfreq_target (drivers/gpu/drm/msm/msm_gpu_devfreq.c:51)
> devfreq_set_target (drivers/devfreq/devfreq.c:360)
> devfreq_update_target (drivers/devfreq/devfreq.c:426)
> devfreq_monitor (drivers/devfreq/devfreq.c:458)
> process_one_work (arch/arm64/include/asm/jump_label.h:36 include/trace/events/workqueue.h:110 kernel/workqueue.c:3284)
> worker_thread (kernel/workqueue.c:3356 (discriminator 2) kernel/workqueue.c:3443 (discriminator 2))
> kthread (kernel/kthread.c:467)
> ret_from_fork (arch/arm64/kernel/entry.S:861)
>
> Fixes: 55213e1acec9 ("clk: qcom: Add gfx3d ping-pong PLL frequency switching")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
I'm still not fully understanding the logic of this code, but I
feel even less comfortable having a board crash on boot and I can
attest to there being a dereference of best_parent_hw..
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
> drivers/clk/qcom/clk-rcg2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
> index 2838d4cb2d58..d0a5847f9111 100644
> --- a/drivers/clk/qcom/clk-rcg2.c
> +++ b/drivers/clk/qcom/clk-rcg2.c
> @@ -1264,6 +1264,7 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw,
> if (req->max_rate < parent_req.max_rate)
> parent_req.max_rate = req->max_rate;
>
> + parent_req.best_parent_hw = req->best_parent_hw;
> ret = __clk_determine_rate(req->best_parent_hw, &parent_req);
> if (ret)
> return ret;
>
> ---
> base-commit: b775e489bec70895b7ef6b66927886bbac79598f
> change-id: 20260117-db820-fix-gfx3d-e61329023c8a
>
> Best regards,
next prev parent reply other threads:[~2026-01-19 14:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-17 3:54 Dmitry Baryshkov
2026-01-19 14:04 ` Konrad Dybcio [this message]
2026-01-19 15:21 ` Abel Vesa
2026-01-19 15:39 ` Bjorn Andersson
2026-01-20 15:14 ` Brian Masney
2026-01-21 2:25 ` Bjorn Andersson
2026-01-21 2:35 ` Bjorn Andersson
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=1f4e300d-b705-4973-bda9-0eb1be6059a3@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/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
all inboxes | Powered by JetHome®