diff mbox series

[v3,4/5] drm/i915: Clarify flow for disabling IRQs on storms

Message ID 20181103001909.23645-5-lyude@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: HPD IRQ storm detection fixes | expand

Commit Message

Lyude Paul Nov. 3, 2018, 12:19 a.m. UTC
This is rather confusing to look at as-is:
dev_priv->display.hpd_irq_setup(dev_priv); in intel_hpd_irq_handler()
handles disabling the actual HPD IRQ, while
intel_hpd_irq_storm_disable() handles moving the HPD pin state over from
MARK_DISABLED to DISABLED along with enabling polling for it.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/i915/intel_hotplug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Rodrigo Vivi Nov. 5, 2018, 8:38 p.m. UTC | #1
On Fri, Nov 02, 2018 at 08:19:07PM -0400, Lyude Paul wrote:
> This is rather confusing to look at as-is:
> dev_priv->display.hpd_irq_setup(dev_priv); in intel_hpd_irq_handler()
> handles disabling the actual HPD IRQ, while
> intel_hpd_irq_storm_disable() handles moving the HPD pin state over from
> MARK_DISABLED to DISABLED along with enabling polling for it.

what about also changing the name of the function?

> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/i915/intel_hotplug.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
> index c11d73de16f2..e5e3eeb7e482 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -351,7 +351,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
>  	hpd_event_bits = dev_priv->hotplug.event_bits;
>  	dev_priv->hotplug.event_bits = 0;
>  
> -	/* Disable hotplug on connectors that hit an irq storm. */
> +	/* Enable polling for connectors which had HPD IRQ storms */
>  	intel_hpd_irq_storm_disable(dev_priv);

This now gets confusing to my brain...
comment says "enable" function name is "disable".

>
>  	spin_unlock_irq(&dev_priv->irq_lock);
> @@ -458,6 +458,10 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
>  		}
>  	}
>  
> +	/*
> +	 * Disable any IRQs that storms were detected on. Polling enablement
> +	 * happens later in our hotplug work.
> +	 */
>  	if (storm_detected && dev_priv->display_irqs_enabled)
>  		dev_priv->display.hpd_irq_setup(dev_priv);
>  	spin_unlock(&dev_priv->irq_lock);
> -- 
> 2.19.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c
index c11d73de16f2..e5e3eeb7e482 100644
--- a/drivers/gpu/drm/i915/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/intel_hotplug.c
@@ -351,7 +351,7 @@  static void i915_hotplug_work_func(struct work_struct *work)
 	hpd_event_bits = dev_priv->hotplug.event_bits;
 	dev_priv->hotplug.event_bits = 0;
 
-	/* Disable hotplug on connectors that hit an irq storm. */
+	/* Enable polling for connectors which had HPD IRQ storms */
 	intel_hpd_irq_storm_disable(dev_priv);
 
 	spin_unlock_irq(&dev_priv->irq_lock);
@@ -458,6 +458,10 @@  void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
 		}
 	}
 
+	/*
+	 * Disable any IRQs that storms were detected on. Polling enablement
+	 * happens later in our hotplug work.
+	 */
 	if (storm_detected && dev_priv->display_irqs_enabled)
 		dev_priv->display.hpd_irq_setup(dev_priv);
 	spin_unlock(&dev_priv->irq_lock);