Re: [PATCH] clk: qcom: ipq-cmn-pll: keep the CMN block bus clocks enabled
Mieczyslaw Nalewaj <[email protected]> Sun, 2 Aug 2026 22:53:45 +0200
| Newsgroups | org.kernel.vger.linux-clk,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On 7/30/2026 9:13 PM, Stanislaw Pal wrote:
> 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: [email protected]
> Signed-off-by: Stanislaw Pal <[email protected]>
> ---
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>