diff mbox

[2/2] drm/i915/mst: Reset MST after resume when necessary

Message ID 1463667596-25236-2-git-send-email-cpaul@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

cpaul@redhat.com May 19, 2016, 2:19 p.m. UTC
A follow-up to the previous commit, we skip checking the status of the
MST device and completely reprobe it if drm_dp_mst_topology_mgr_resume()
returns -EINVAL.

Cc: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index db6a0fd..5b62f7e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -6063,6 +6063,7 @@  void intel_dp_mst_suspend(struct drm_device *dev)
 void intel_dp_mst_resume(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_dp_mst_topology_mgr *mgr;
 	int i;
 
 	for (i = 0; i < I915_MAX_PORTS; i++) {
@@ -6075,8 +6076,14 @@  void intel_dp_mst_resume(struct drm_device *dev)
 			if (!intel_dig_port->dp.can_mst)
 				continue;
 
-			ret = drm_dp_mst_topology_mgr_resume(&intel_dig_port->dp.mst_mgr);
-			if (ret != 0) {
+			mgr = &intel_dig_port->dp.mst_mgr;
+
+			ret = drm_dp_mst_topology_mgr_resume(mgr);
+			/* A full reset is required */
+			if (ret == -EINVAL) {
+				drm_dp_mst_topology_mgr_set_mst(mgr, false);
+				intel_dp_probe_mst(&intel_dig_port->dp);
+			} else if (ret != 0) {
 				intel_dp_check_mst_status(&intel_dig_port->dp);
 			}
 		}