drm/msm/dsi: dsi_phy_14nm: Take ready-bit into account in poll_for_ready
authorMarijn Suijten <marijn.suijten@somainline.org>
Mon, 6 Sep 2021 20:25:51 +0000 (22:25 +0200)
committerRob Clark <robdclark@chromium.org>
Tue, 12 Oct 2021 00:30:53 +0000 (17:30 -0700)
commit90b7c1c66132c20e8a550006011a3cbfb73dbfc1
tree6661a0c7f9eba58f0c2d12a6c2897f3a2a843f7c
parentad69b73add8967bc92b62a1cf23a911705781488
drm/msm/dsi: dsi_phy_14nm: Take ready-bit into account in poll_for_ready

The downstream driver models this PLL lock check as an if-elseif-else.
The only way to reach the else case where pll_locked=true [1] is by
succeeding both readl_poll_timeout_atomic calls (which return zero on
success) in the if _and_ elseif condition.  Hence both the "lock" and
"ready" bit need to be tested in the SM_READY_STATUS register before
considering the PLL locked and ready to go.

Tested on the Sony Xperia XA2 Ultra (nile-discovery, sdm630).

[1]: https://source.codeaurora.org/quic/la/kernel/msm-4.19/tree/drivers/clk/qcom/mdss/mdss-dsi-pll-14nm-util.c?h=LA.UM.9.2.1.r1-08000-sdm660.0#n302

Fixes: f079f6d999cb ("drm/msm/dsi: Add PHY/PLL for 8x96")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210906202552.824598-1-marijn.suijten@somainline.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c