diff mbox

hotplug storms still here

Message ID AANLkTikMioIlfJkdz6vGCyL102qcG_Z_Csm57MF1JMp8@mail.gmail.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Andrew Lutomirski June 8, 2010, 8:12 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index df6a9cd..58e403a 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -903,8 +903,8 @@  irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 		    (iir & I915_DISPLAY_PORT_INTERRUPT)) {
 			u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT);

-			DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n",
-				  hotplug_status);
+			printk(KERN_ERR "hotplug event received, iir 0x%08x, stat 0x%08x,
mask 0x%08x\n",
+				iir, hotplug_status, dev_priv->hotplug_supported_mask);
 			if (hotplug_status & dev_priv->hotplug_supported_mask)
 				queue_work(dev_priv->wq,
 					   &dev_priv->hotplug_work);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 77e40cf..3ac3dd8 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1172,6 +1172,7 @@  intel_dp_detect(struct drm_connector *connector)
 	struct drm_device *dev = intel_encoder->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_dp_priv *dp_priv = intel_encoder->dev_priv;
+	uint32_t orig_hotplug_en;
 	uint32_t temp, bit;
 	enum drm_connector_status status;

@@ -1180,10 +1181,10 @@  intel_dp_detect(struct drm_connector *connector)
 	if (HAS_PCH_SPLIT(dev))
 		return ironlake_dp_detect(connector);

-	temp = I915_READ(PORT_HOTPLUG_EN);
+	orig_hotplug_en = I915_READ(PORT_HOTPLUG_EN);

 	I915_WRITE(PORT_HOTPLUG_EN,
-	       temp |
+	       orig_hotplug_en |
 	       DPB_HOTPLUG_INT_EN |
 	       DPC_HOTPLUG_INT_EN |
 	       DPD_HOTPLUG_INT_EN);
@@ -1201,13 +1202,16 @@  intel_dp_detect(struct drm_connector *connector)
 		bit = DPD_HOTPLUG_INT_STATUS;
 		break;
 	default:
-		return connector_status_unknown;
+		status = connector_status_unknown;
+		goto out;
 	}

 	temp = I915_READ(PORT_HOTPLUG_STAT);

-	if ((temp & bit) == 0)
-		return connector_status_disconnected;
+	if ((temp & bit) == 0) {
+		status = connector_status_disconnected;
+		goto out;
+	}

 	status = connector_status_disconnected;
 	if (intel_dp_aux_native_read(intel_encoder,
@@ -1217,6 +1221,9 @@  intel_dp_detect(struct drm_connector *connector)
 		if (dp_priv->dpcd[0] != 0)
 			status = connector_status_connected;
 	}
+
+out:
+	I915_WRITE(PORT_HOTPLUG_EN, orig_hotplug_en);
 	return status;
 }