All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add messages usful for HPD strom detection debugging
@ 2013-07-26 10:30 Egbert Eich
  2013-07-26 11:25 ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Egbert Eich @ 2013-07-26 10:30 UTC (permalink / raw)
  To: intel-gfx; +Cc: Egbert Eich, Daniel Vetter

For HPD storm detection we now mask out individual interrupt source
bits. We have already seen a case where HPD interrupt enable bits
were assigned to the wrong pins. To track these conditions more
easily add some debugging messages.

Signed-off-by: Egbert Eich <eich@suse.de>
---
 drivers/gpu/drm/i915/i915_irq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ee3e49c..1f3a971 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -919,6 +919,10 @@ 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++) {
 
+		WARN(((hpd[i] & hotplug_trigger) &&
+		      dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED),
+		     "Received HPD intterupt although disabled\n");
+
 		if (!(hpd[i] & hotplug_trigger) ||
 		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
 			continue;
@@ -929,6 +933,7 @@ 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 - cnt: 0\n", i);
 		} 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 +941,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);
 		}
 	}
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915: Add messages usful for HPD strom detection debugging
  2013-07-26 10:30 [PATCH] drm/i915: Add messages usful for HPD strom detection debugging Egbert Eich
@ 2013-07-26 11:25 ` Jani Nikula
  2013-07-26 12:14   ` [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2) Egbert Eich
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2013-07-26 11:25 UTC (permalink / raw)
  To: intel-gfx; +Cc: Egbert Eich, Daniel Vetter

On Fri, 26 Jul 2013, Egbert Eich <eich@suse.de> wrote:
> For HPD storm detection we now mask out individual interrupt source
> bits. We have already seen a case where HPD interrupt enable bits
> were assigned to the wrong pins. To track these conditions more
> easily add some debugging messages.

The code seems okay, please spellcheck the subject and debug prints! :)

BR,
Jani.

>
> Signed-off-by: Egbert Eich <eich@suse.de>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index ee3e49c..1f3a971 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -919,6 +919,10 @@ 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++) {
>  
> +		WARN(((hpd[i] & hotplug_trigger) &&
> +		      dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED),
> +		     "Received HPD intterupt although disabled\n");
> +
>  		if (!(hpd[i] & hotplug_trigger) ||
>  		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
>  			continue;
> @@ -929,6 +933,7 @@ 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 - cnt: 0\n", i);
>  		} 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 +941,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);
>  		}
>  	}
>  
> -- 
> 1.8.1.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2)
  2013-07-26 11:25 ` Jani Nikula
@ 2013-07-26 12:14   ` Egbert Eich
  2013-07-26 12:23     ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Egbert Eich @ 2013-07-26 12:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: Egbert Eich, Daniel Vetter

For HPD storm detection we now mask out individual interrupt source
bits. We have already seen a case where HPD interrupt enable bits
were assigned to the wrong pins. To track these conditions more
easily add some debugging messages.

v2: Spelling fixes as suggested by Jani Nikula <jani.nikula@linux.intel.com>

Signed-off-by: Egbert Eich <eich@suse.de>
---
 drivers/gpu/drm/i915/i915_irq.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ee3e49c..6a1c207 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -919,6 +919,10 @@ 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++) {
 
+		WARN(((hpd[i] & hotplug_trigger) &&
+		      dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED),
+		     "Received HPD interrupt although disabled\n");
+
 		if (!(hpd[i] & hotplug_trigger) ||
 		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
 			continue;
@@ -929,6 +933,7 @@ 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 - cnt: 0\n", i);
 		} 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 +941,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);
 		}
 	}
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2)
  2013-07-26 12:14   ` [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2) Egbert Eich
@ 2013-07-26 12:23     ` Jani Nikula
  2013-07-26 17:44       ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2013-07-26 12:23 UTC (permalink / raw)
  To: intel-gfx; +Cc: Egbert Eich, Daniel Vetter

On Fri, 26 Jul 2013, Egbert Eich <eich@suse.de> wrote:
> For HPD storm detection we now mask out individual interrupt source
> bits. We have already seen a case where HPD interrupt enable bits
> were assigned to the wrong pins. To track these conditions more
> easily add some debugging messages.
>
> v2: Spelling fixes as suggested by Jani Nikula <jani.nikula@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> Signed-off-by: Egbert Eich <eich@suse.de>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index ee3e49c..6a1c207 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -919,6 +919,10 @@ 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++) {
>  
> +		WARN(((hpd[i] & hotplug_trigger) &&
> +		      dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED),
> +		     "Received HPD interrupt although disabled\n");
> +
>  		if (!(hpd[i] & hotplug_trigger) ||
>  		    dev_priv->hpd_stats[i].hpd_mark != HPD_ENABLED)
>  			continue;
> @@ -929,6 +933,7 @@ 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 - cnt: 0\n", i);
>  		} 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 +941,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);
>  		}
>  	}
>  
> -- 
> 1.8.1.4
>

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2)
  2013-07-26 12:23     ` Jani Nikula
@ 2013-07-26 17:44       ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2013-07-26 17:44 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Egbert Eich, Daniel Vetter, intel-gfx

On Fri, Jul 26, 2013 at 03:23:54PM +0300, Jani Nikula wrote:
> On Fri, 26 Jul 2013, Egbert Eich <eich@suse.de> wrote:
> > For HPD storm detection we now mask out individual interrupt source
> > bits. We have already seen a case where HPD interrupt enable bits
> > were assigned to the wrong pins. To track these conditions more
> > easily add some debugging messages.
> >
> > v2: Spelling fixes as suggested by Jani Nikula <jani.nikula@linux.intel.com>
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-26 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 10:30 [PATCH] drm/i915: Add messages usful for HPD strom detection debugging Egbert Eich
2013-07-26 11:25 ` Jani Nikula
2013-07-26 12:14   ` [PATCH V2] drm/i915: Add messages useful for HPD storm detection debugging (v2) Egbert Eich
2013-07-26 12:23     ` Jani Nikula
2013-07-26 17:44       ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.