[Intel-gfx] hotplug storms still here

Andrew Lutomirski luto at mit.edu
Tue Jun 8 10:12:06 CEST 2010


On my trusty X200s (GM45), I still have such frequent i915 hotplug
storms that any standard kernel is essentially unusable.

Here's an example:


[  138.717645] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.718029] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.718157] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.719149] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.719389] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.719780] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.720682] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.721418] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.721804] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.722265] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.723540] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.723841] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.724501] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.725796] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.726601] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.727630] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.727965] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.728469] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.728627] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.729078] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.729251] hotplug event received, iir 0x00020000, stat
0x28200000, mask 0x38000800
[  138.729339] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.729795] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.730578] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800
[  138.730667] hotplug event received, iir 0x00020000, stat
0x20200000, mask 0x38000800

etc.  (I often see statuses different from 0x20200000.)

That's with this patch applied:


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;
 }

(The latter part was an attempt to fix it that didn't work.  But it or
something like it should probably be applied at some point.)

Completely disabling DP, HDMI, and SDVO init fixes the problem, but
having to patch every kernel I run is getting old.  Any ideas?

The only possibilities I can think of are:

 - Hardware problem with my laptop?  But if I manually clear
PORT_HOTPLUG_EN with intel_reg_write, then I stop getting interrupts
(at least last time I tried) even if I reenable all the bits.
 - Maybe clearing the hotplug status before IIR in
i915_driver_irq_handler isn't right.
 - Maybe something that the system does in response to a hotplug
interrupt triggers another one.

I'll try selectively disabling outputs and seeing if I can narrow it down.

--Andy



More information about the Intel-gfx mailing list