From: Stanislaw Pal <kuncy7@gmail.com>
To: Bjorn Andersson <andersson@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>
Cc: Luo Jie <jie.luo@oss.qualcomm.com>,
Brian Masney <bmasney@redhat.com>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Stanislaw Pal <kuncy7@gmail.com>
Subject: [PATCH] clk: qcom: ipq-cmn-pll: keep the CMN block bus clocks enabled
Date: Thu, 30 Jul 2026 21:13:53 +0200 [thread overview]
Message-ID: <20260730191353.557494-1-kuncy7@gmail.com> (raw)
The probe function takes a runtime PM reference to enable the GCC AHB &
SYS clocks of the CMN PLL block, registers the clocks, and then drops
the reference. Once the autosuspend kicks in, pm_clk gates both clocks
a few milliseconds after probe has returned.
That is wrong on two counts:
- The clock ops access the CMN PLL registers without taking a runtime
PM reference of their own, so any later clk_set_rate() or rate
recalculation touches the register file with its bus clock gated.
- On IPQ5018 the consequences are not contained to this device:
gating the CMN block bus clocks makes the SoC hang on a subsequent
bus access. Measured on a TP-Link Archer AX55 v1 (IPQ5018), the
machine dies silently within a few milliseconds of the CMN PLL
probe returning - mid-character on the UART - and the victim is
whichever device happens to probe next. Whether a given boot
survives the window is a micro-timing lottery: different binary
layouts of the same kernel ranged from occasional failures to a
100% reproducible boot loop.
Keep the runtime PM usage count elevated on the probe success path, so
the bus clocks stay enabled. With this one change the same board went
from boot-looping to surviving every boot attempt (verified across
three previously-failing kernel binaries, plus repeated soft and hard
resets on the final one).
Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Pal <kuncy7@gmail.com>
---
One more observation from the same debugging session, for the people
who know this silicon: on IPQ5018 the CMN_PLL_LOCKED bit (offset 0x64,
bit 8) never asserts. Every clk_cmn_pll_set_rate() call runs its
regmap_read_poll_timeout() to the full 100 ms timeout - including under
the bootloader-programmed configuration the hardware demonstrably runs
fine with - and nobody notices, because clk_change_rate() ignores the
.set_rate return value, so the -ETIMEDOUT is swallowed silently. Is the
lock status readable at a different offset on this SoC, or is the bit
simply not functional there? Happy to send a follow-up (surfacing the
error, or skipping the poll where it cannot work) once someone can say
what the intended behavior is.
drivers/clk/qcom/ipq-cmn-pll.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/drivers/clk/qcom/ipq-cmn-pll.c
+++ b/drivers/clk/qcom/ipq-cmn-pll.c
@@ -454,11 +454,19 @@
/* Register CMN PLL clock and fixed rate output clocks. */
ret = ipq_cmn_pll_register_clks(pdev);
- pm_runtime_put(dev);
- if (ret)
+ if (ret) {
+ pm_runtime_put(dev);
return dev_err_probe(dev, ret,
"Failed to register CMN PLL clocks\n");
+ }
+ /*
+ * Keep the runtime PM usage count elevated on the success path, so
+ * the CMN block AHB & SYS clocks stay enabled: the clock ops access
+ * the CMN PLL registers without taking a runtime PM reference, and
+ * on IPQ5018 gating these clocks after probe hangs the SoC on a
+ * subsequent bus access.
+ */
return 0;
}
reply other threads:[~2026-07-30 19:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260730191353.557494-1-kuncy7@gmail.com \
--to=kuncy7@gmail.com \
--cc=andersson@kernel.org \
--cc=bmasney@redhat.com \
--cc=jie.luo@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 \
--cc=stable@vger.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