Re: [PATCH] drm/msm/dsi: fix AHB clock staying enabled across suspend

From: Dmitry Baryshkov

Date: Wed Nov 11 2026 - 12:45:46 EST


On Tue, Oct 06, 2026 at 06:43:53PM +0530, Arpit Saini wrote:
> pm_clk_suspend()/resume() only call clk_disable()/clk_enable() for the
> AHB ("iface") clock, never clk_unprepare(), so prepare_count never
> reaches 0. The clock (and its source) stays reported as enabled
> through s2idle suspend even though the display stack is fully
> suspended:
>
> disp_cc_mdss_ahb_clk [19200000] ->
> disp_cc_mdss_ahb_clk_src [19200000] ->
> bi_tcxo [19200000] -> xo-board [76800000]
> disp_cc_mdss_ahb_clk_src [19200000] ->
> bi_tcxo [19200000] -> xo-board [76800000]
>
> Calling clk_prepare_enable()/clk_disable_unprepare() directly from the
> PHY's runtime_suspend/runtime_resume is not safe either, since it can
> deadlock against the PHY's own PLL clocks taking the global CCF
> prepare_lock during clk_prepare()/clk_unprepare().
>
> Fix this by moving clk_prepare()/clk_unprepare() out of the runtime PM
> path. clk_enable()/clk_disable() (spinlock only) stay in
> runtime_suspend/runtime_resume. clk_prepare()/clk_unprepare() move to
> suspend_late/resume_early, avoiding the prepare_lock collision and
> actually dropping prepare_count to 0. DPM_FLAG_NO_DIRECT_COMPLETE
> ensures these hooks always run on sleep.
>
> Fixes: 0b3ccb76b95b ("drm/msm/dsi: Fix 14nm DSI PHY PLL Lock issue")
> Signed-off-by: Arpit Saini <arpit.saini@xxxxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 132 +++++++++++++++++++++++++++++++---
> drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 4 ++
> 2 files changed, 127 insertions(+), 9 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>


--
With best wishes
Dmitry