aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyude <cpaul@redhat.com>2016-04-13 16:50:18 -0400
committerDave Airlie <airlied@redhat.com>2016-04-26 19:29:40 -0400
commit9dc0487d96a0396367a1451b31873482080b527f (patch)
treedc083818cc8043589069ae0ec9bb5bc9285ff38a
parent263efde31f97c498e1ebad30e4d2906609d7ad6b (diff)
drm/dp/mst: Restore primary hub guid on resume
Some hubs are forgetful, and end up forgetting whatever GUID we set previously after we do a suspend/resume cycle. This can lead to hotplugging breaking (along with probably other things) since the hub will start sending connection notifications with the wrong GUID. As such, we need to check on resume whether or not the GUID the hub is giving us is valid. Signed-off-by: Lyude <cpaul@redhat.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1460580618-7421-1-git-send-email-cpaul@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_dp_mst_topology.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 935d8cc46841..71ea0521ea96 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2136,6 +2136,8 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr)
2136 2136
2137 if (mgr->mst_primary) { 2137 if (mgr->mst_primary) {
2138 int sret; 2138 int sret;
2139 u8 guid[16];
2140
2139 sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE); 2141 sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE);
2140 if (sret != DP_RECEIVER_CAP_SIZE) { 2142 if (sret != DP_RECEIVER_CAP_SIZE) {
2141 DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n"); 2143 DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
@@ -2150,6 +2152,16 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr)
2150 ret = -1; 2152 ret = -1;
2151 goto out_unlock; 2153 goto out_unlock;
2152 } 2154 }
2155
2156 /* Some hubs forget their guids after they resume */
2157 sret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16);
2158 if (sret != 16) {
2159 DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
2160 ret = -1;
2161 goto out_unlock;
2162 }
2163 drm_dp_check_mstb_guid(mgr->mst_primary, guid);
2164
2153 ret = 0; 2165 ret = 0;
2154 } else 2166 } else
2155 ret = -1; 2167 ret = -1;