linux/drivers/gpu/drm/msm/dsi
Dmitry Baryshkov 2028280686 drm/msm/dsi: round the byte clock rate after reparenting to the PHY PLL
DSI 6G v2.9 hosts (SM8650, SM8750, Kaanapali, etc.) reparent the byte and
pixel RCGs to the DSI PHY PLL at runtime from
dsi_link_clk_set_rate_6g_v2_9(), after the PHY has been enabled. However
dsi_calc_clk_rate_6g() runs earlier, in order to compute the bit clock
request for the PHY. At that point the byte RCG still has its reset
parent (XO), so clk_round_rate() returns a bogus rate, which then ends up
in the PHY bit clock request and the PLL gets programmed to a wrong
frequency, breaking the panel.

Move the rounding to dsi_link_clk_set_rate_6g(), which is called after
the RCGs have been reparented to the PLL. Storing the rounded rate at
this point still makes later link_clk_set_rate() calls no-ops in the
CCF. Derive the byte interface clock rate from the rounded byte clock
rate, otherwise it would keep requesting the idealized rate and
retrigger the PLL on every transfer.

Reported-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Fixes: 6cd33b6f41 ("drm/msm/dsi: round 6G byte clock rate to the PLL-achievable value")
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> # SM6115P J606F
Tested-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/750496/
Link: https://lore.kernel.org/r/20260903-fix-eliza-dsi-v1-1-3474a6c9f2e0@oss.qualcomm.com
2026-09-15 02:09:28 +03:00
..
phy Revert "drm/msm: dsi: fix PLL init in bonded mode" 2026-07-12 14:59:01 +03:00
dsi_cfg.c drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0 2026-03-25 14:06:10 +02:00
dsi_cfg.h drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0 2026-03-25 14:06:10 +02:00
dsi_host.c drm/msm/dsi: round the byte clock rate after reparenting to the PHY PLL 2026-09-15 02:09:28 +03:00
dsi_manager.c drm/msm: dsi: Switch to atomic bridge callbacks 2026-07-15 09:46:11 +02:00
dsi.c drm/msm: add missing MODULE_DEVICE_ID definitions 2026-03-25 08:06:03 +02:00
dsi.h drm/msm/dsi: Add support for SM8750 2025-07-04 16:35:19 +03:00