linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show()
@ 2018-11-21  0:37 Lyude Paul
  2018-11-21 10:06 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Lyude Paul @ 2018-11-21  0:37 UTC (permalink / raw)
  To: intel-gfx
  Cc: Ville Syrjälä,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	dri-devel, linux-kernel

While trying to add a chamelium test for short HPD IRQs, I ran into
issues where a hotplug storm would be triggered, but the point at which
it would be reported by the kernel would be after igt actually finished
checking i915_hpd_storm_ctl's status. So, fix this by simply
synchronizing our IRQ work, dig_port_work, and hotplug_work before
printing out the HPD storm status in i915_hpd_storm_ctl_show().

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

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 69447c68b9af..af4268a6d2d9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4592,6 +4592,13 @@ static int i915_hpd_storm_ctl_show(struct seq_file *m, void *data)
 	struct drm_i915_private *dev_priv = m->private;
 	struct i915_hotplug *hotplug = &dev_priv->hotplug;
 
+	/* Synchronize with everything first in case there's been an HPD
+	 * storm, but we haven't finished handling it in the kernel yet
+	 */
+	synchronize_irq(dev_priv->drm.irq);
+	flush_work(&dev_priv->hotplug.dig_port_work);
+	flush_work(&dev_priv->hotplug.hotplug_work);
+
 	seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold);
 	seq_printf(m, "Detected: %s\n",
 		   yesno(delayed_work_pending(&hotplug->reenable_work)));
-- 
2.19.1


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

* Re: [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show()
  2018-11-21  0:37 [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show() Lyude Paul
@ 2018-11-21 10:06 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2018-11-21 10:06 UTC (permalink / raw)
  To: Lyude Paul; +Cc: intel-gfx, David Airlie, linux-kernel, dri-devel, Rodrigo Vivi

On Tue, Nov 20, 2018 at 07:37:17PM -0500, Lyude Paul wrote:
> While trying to add a chamelium test for short HPD IRQs, I ran into
> issues where a hotplug storm would be triggered, but the point at which
> it would be reported by the kernel would be after igt actually finished
> checking i915_hpd_storm_ctl's status. So, fix this by simply
> synchronizing our IRQ work, dig_port_work, and hotplug_work before
> printing out the HPD storm status in i915_hpd_storm_ctl_show().
> 
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>

Makes sense.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 69447c68b9af..af4268a6d2d9 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4592,6 +4592,13 @@ static int i915_hpd_storm_ctl_show(struct seq_file *m, void *data)
>  	struct drm_i915_private *dev_priv = m->private;
>  	struct i915_hotplug *hotplug = &dev_priv->hotplug;
>  
> +	/* Synchronize with everything first in case there's been an HPD
> +	 * storm, but we haven't finished handling it in the kernel yet
> +	 */
> +	synchronize_irq(dev_priv->drm.irq);
> +	flush_work(&dev_priv->hotplug.dig_port_work);
> +	flush_work(&dev_priv->hotplug.hotplug_work);
> +
>  	seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold);
>  	seq_printf(m, "Detected: %s\n",
>  		   yesno(delayed_work_pending(&hotplug->reenable_work)));
> -- 
> 2.19.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2018-11-21 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21  0:37 [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show() Lyude Paul
2018-11-21 10:06 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).