]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/dsi/phy_7nm: Fix missing initial VCO rate
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 10 Jun 2025 14:05:47 +0000 (16:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:18 +0000 (15:34 -0500)
[ Upstream commit 5ddcb0cb9d10e6e70a68e0cb8f0b8e3a7eb8ccaf ]

Driver unconditionally saves current state on first init in
dsi_pll_7nm_init(), but does not save the VCO rate, only some of the
divider registers.  The state is then restored during probe/enable via
msm_dsi_phy_enable() -> msm_dsi_phy_pll_restore_state() ->
dsi_7nm_pll_restore_state().

Restoring calls dsi_pll_7nm_vco_set_rate() with
pll_7nm->vco_current_rate=0, which basically overwrites existing rate of
VCO and messes with clock hierarchy, by setting frequency to 0 to clock
tree.  This makes anyway little sense - VCO rate was not saved, so
should not be restored.

If PLL was not configured configure it to minimum rate to avoid glitches
and configuring entire in clock hierarchy to 0 Hz.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/657827/
Link: https://lore.kernel.org/r/20250610-b4-sm8750-display-v6-9-ee633e3ddbff@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c

index ec5aa8cb37d9a2dde03febf5100cf60f421ac8f2..0f8440fa73b4a9c28b346513150f2d9c89ded2e2 100644 (file)
@@ -814,6 +814,12 @@ static int dsi_pll_7nm_init(struct msm_dsi_phy *phy)
 
        /* TODO: Remove this when we have proper display handover support */
        msm_dsi_phy_pll_save_state(phy);
+       /*
+        * Store also proper vco_current_rate, because its value will be used in
+        * dsi_7nm_pll_restore_state().
+        */
+       if (!dsi_pll_7nm_vco_recalc_rate(&pll_7nm->clk_hw, VCO_REF_CLK_RATE))
+               pll_7nm->vco_current_rate = pll_7nm->phy->cfg->min_pll_rate;
 
        return 0;
 }