diff mbox

i915 irq storm mitigation in 3.10

Message ID 20974.26726.659962.223064@linux-qknr.site (mailing list archive)
State New, archived
Headers show

Commit Message

Egbert Eich July 23, 2013, 11:26 a.m. UTC
Hi Jan -

Jan Niggemann writes:
 > 
 > As to the log: I messed up the kernel parameters this morning... was 
 > out of coffee this morning and my 1,5y daughter played around me :-)
 > 
 > Here's my kernel log with drm.debug and printk.time enabled:
 > Uncompressed (22M): http://files.hz6.de/kern_20130722.log
 > bzip2'd (some 600 KB): http://files.hz6.de/kern_20130722.log.bz2

I've looked at the logs a bit more. Here's a patch adding some more
debug information. Would you please apply this to your 3.10 kernel
and generate a log file the same way as you did before.
The driver will be even more chatty - but I don't expect any problems
from this.

Cheers,
	Egbert.

Comments

Jan Niggemann July 24, 2013, 8:52 p.m. UTC | #1
Hi Egbert,

Am 23.07.2013 13:26, schrieb Egbert Eich:
> I've looked at the logs a bit more. Here's a patch adding some more
> debug information. Would you please apply this to your 3.10 kernel
> and generate a log file the same way as you did before.
> The driver will be even more chatty - but I don't expect any problems
> from this.

> diff --git a/drivers/gpu/drm/i915/i915_irq.c
> b/drivers/gpu/drm/i915/i915_irq.c
> index e43d809..46bb77c 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -919,6 +919,11 @@ static inline void intel_hpd_irq_handler(struct
> drm_device *dev,
>  	spin_lock(&dev_priv->irq_lock);
>  	for (i = 1; i < HPD_NUM_PINS; i++) {
>
> +		if (IS_G4X(dev) && (hpd[i] & hotplug_trigger) &&
> +		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
> +			DRM_DEBUG_KMS("Received HPD intterupt although disabled\n",
> +				      I915_READ(PORT_HOTPLUG_EN));
> +
>  		if (!(hpd[i] & hotplug_trigger) ||
>  		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
>  			continue;
> @@ -929,6 +934,8 @@ static inline void intel_hpd_irq_handler(struct
> drm_device *dev,
>  				   + msecs_to_jiffies(HPD_STORM_DETECT_PERIOD))) {
>  			dev_priv->hpd_stats[i].hpd_last_jiffies = jiffies;
>  			dev_priv->hpd_stats[i].hpd_cnt = 0;
> +			DRM_DEBUG_KMS("Received HPD interrupt on PIN %d - jiffies: %d\n", 
> i,
> +				      dev_priv->hpd_stats[i].hpd_last_jiffies);
>  		} else if (dev_priv->hpd_stats[i].hpd_cnt > HPD_STORM_THRESHOLD) {
>  			dev_priv->hpd_stats[i].hpd_mark = HPD_MARK_DISABLED;
>  			dev_priv->hpd_event_bits &= ~(1 << i);
> @@ -936,6 +943,8 @@ static inline void intel_hpd_irq_handler(struct
> drm_device *dev,
>  			storm_detected = true;
>  		} else {
>  			dev_priv->hpd_stats[i].hpd_cnt++;
> +			DRM_DEBUG_KMS("Received HPD interrupt on PIN %d - cnt: %d\n", i,
> +				      dev_priv->hpd_stats[i].hpd_cnt);
>  		}
>  	}
I applied this patch (but not the one you sent on Monday), recompiled 
and logged:
uncompressed (8,2M) http://files.hz6.de/kern_20130724.log
bz2 (288 KB) http://files.hz6.de/kern_20130724.log.bz2

Hope this helps,
Regards
jan
Egbert Eich July 25, 2013, 7:50 a.m. UTC | #2
Hi Jan!

Jan Niggemann writes:
 > Hi Egbert,

[...]

Thanks for generating the logs! Hope you had a nice birthday dinner :)

 > 
 > I applied this patch (but not the one you sent on Monday), recompiled 
 > and logged:
 > uncompressed (8,2M) http://files.hz6.de/kern_20130724.log
 > bz2 (288 KB) http://files.hz6.de/kern_20130724.log.bz2

These logs show clearly that we are seeing interrupts which
should be disabled.
Could it be that we we have either the status or enable bits
mixed up? Unfortunately the publically available docs for GEN4
don't show the HOTPLUG_EN and HOTPLUG_STAT registers.

Daniel, could you please help me out here?

Thanks a lot!

Cheers,
	Egbert.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e43d809..46bb77c 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -919,6 +919,11 @@  static inline void intel_hpd_irq_handler(struct drm_device *dev,
 	spin_lock(&dev_priv->irq_lock);
 	for (i = 1; i < HPD_NUM_PINS; i++) {
 
+		if (IS_G4X(dev) && (hpd[i] & hotplug_trigger) &&
+		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
+			DRM_DEBUG_KMS("Received HPD intterupt although disabled\n",
+				      I915_READ(PORT_HOTPLUG_EN));
+
 		if (!(hpd[i] & hotplug_trigger) ||
 		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
 			continue;
@@ -929,6 +934,8 @@  static inline void intel_hpd_irq_handler(struct drm_device *dev,
 				   + msecs_to_jiffies(HPD_STORM_DETECT_PERIOD))) {
 			dev_priv->hpd_stats[i].hpd_last_jiffies = jiffies;
 			dev_priv->hpd_stats[i].hpd_cnt = 0;
+			DRM_DEBUG_KMS("Received HPD interrupt on PIN %d - jiffies: %d\n", i,
+				      dev_priv->hpd_stats[i].hpd_last_jiffies);
 		} else if (dev_priv->hpd_stats[i].hpd_cnt > HPD_STORM_THRESHOLD) {
 			dev_priv->hpd_stats[i].hpd_mark = HPD_MARK_DISABLED;
 			dev_priv->hpd_event_bits &= ~(1 << i);
@@ -936,6 +943,8 @@  static inline void intel_hpd_irq_handler(struct drm_device *dev,
 			storm_detected = true;
 		} else {
 			dev_priv->hpd_stats[i].hpd_cnt++;
+			DRM_DEBUG_KMS("Received HPD interrupt on PIN %d - cnt: %d\n", i,
+				      dev_priv->hpd_stats[i].hpd_cnt);
 		}
 	}