Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dp: do not reinitialize phy unless retry during link training

DP PHY re-initialization done using dp_ctrl_reinitialize_mainlink() will
cause PLL unlocked initially and then PLL gets locked at the end of
initialization. PLL_UNLOCKED interrupt will fire during this time if the
interrupt mask is enabled.

However currently DP driver link training implementation incorrectly
re-initializes PHY unconditionally during link training as the PHY was
already configured in dp_ctrl_enable_mainlink_clocks().

Fix this by re-initializing the PHY only if the previous link training
failed.

[drm:dp_aux_isr] *ERROR* Unexpected DP AUX IRQ 0x01000000 when not busy

Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")
Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/30
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/551847/
Link: https://lore.kernel.org/r/1691533190-19335-1-git-send-email-quic_khsieh@quicinc.com
[quic_abhinavk@quicinc.com: added line break in commit text]
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

authored by

Kuogee Hsieh and committed by
Abhinav Kumar
0c1a2e69 ce9ecca0

+6 -7
+6 -7
drivers/gpu/drm/msm/dp/dp_ctrl.c
··· 1774 1774 return rc; 1775 1775 1776 1776 while (--link_train_max_retries) { 1777 - rc = dp_ctrl_reinitialize_mainlink(ctrl); 1778 - if (rc) { 1779 - DRM_ERROR("Failed to reinitialize mainlink. rc=%d\n", 1780 - rc); 1781 - break; 1782 - } 1783 - 1784 1777 training_step = DP_TRAINING_NONE; 1785 1778 rc = dp_ctrl_setup_main_link(ctrl, &training_step); 1786 1779 if (rc == 0) { ··· 1824 1831 1825 1832 /* stop link training before start re training */ 1826 1833 dp_ctrl_clear_training_pattern(ctrl); 1834 + } 1835 + 1836 + rc = dp_ctrl_reinitialize_mainlink(ctrl); 1837 + if (rc) { 1838 + DRM_ERROR("Failed to reinitialize mainlink. rc=%d\n", rc); 1839 + break; 1827 1840 } 1828 1841 } 1829 1842