linux/drivers/gpu/drm/msm/dsi
Neil Armstrong 93c97bc8d8 drm/msm: dsi: fix PLL init in bonded mode
When in bonded DSI mode, only one PLL in one DSI PHY is used for both
DSI PHYs, meaning that parents of the secondary DSI PHY will use the
primary DSI PHY PLL as parent.

In this case the primary DSI PHY PLL will be set even if the primary
DSI PHY is not yet enabled. The DSI PHY code has support for this
particular use-case and will handle the fact the PLL was already
set when initializing the primary DSI PHY.

By introducing a protected variable pll_enable_cnt in the commit
cb55f39bf7 ("drm/msm/dsi/phy: Fix reading zero as PLL rates when unprepared"),
this variable is only initially set to 1 when the DSI PHY is initialized
making it impossible to set the PLL before, breaking the bonded DSI
use case by returning 0 when setting the PLL from the secondary DSI
PHY driver and skipping the correct clocks initialization.

But since it was already possible to set the PLL without enabling
the DSI PHY, just drop the pll_enable_cnt setting from the PHY
enable/disable and simply increment/decrement the pll_enable_cnt
variable from the dsi_pll_enable/disable_pll_bias to make sure any
PLL operation is done with the PLL BIAS enabled.

Fixes: cb55f39bf7 ("drm/msm/dsi/phy: Fix reading zero as PLL rates when unprepared")
Closes: https://lore.kernel.org/all/50a49d72-2b1e-471d-b0c4-d5a0b38b2a21@linaro.org/
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/683688/
Link: https://lore.kernel.org/r/20251027-topic-sm8x50-fix-dsi-bonded-v1-1-a477cd3f907d@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-10-29 00:10:06 +02:00
..
phy drm/msm: dsi: fix PLL init in bonded mode 2025-10-29 00:10:06 +02:00
dsi.c drm/msm: move KMS driver data to msm_kms 2025-07-05 07:13:35 -07:00
dsi.h drm/msm/dsi: Add support for SM8750 2025-07-04 16:35:19 +03:00
dsi_cfg.c drm/msm/dsi: Add support for SM8750 2025-07-04 16:35:19 +03:00
dsi_cfg.h drm/msm/dsi: Add support for SM8750 2025-07-04 16:35:19 +03:00
dsi_host.c drm/msm: Use drm_gpuvm types more 2025-07-04 17:48:35 -07:00
dsi_manager.c drm/msm/dsi: convert to devm_drm_bridge_alloc() API 2025-04-29 11:21:24 +02:00