All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/3] drm/i915: Avoid early GPU idling due to race with new request
@ 2016-11-05  8:35 Imre Deak
  2016-11-05  8:36 ` [PATCH v4 2/3] drm/i915: Make sure engines are idle during GPU idling in LR mode Imre Deak
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Imre Deak @ 2016-11-05  8:35 UTC (permalink / raw)
  To: intel-gfx

There is a small race where a new request can be submitted and retired
after the idle worker started to run which leads to idling the GPU too
early. Fix this by deferring the idling to the pending instance of the
worker.

This scenario was pointed out by Chris.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0dbf38c..36a16df 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2766,6 +2766,13 @@ i915_gem_idle_work_handler(struct work_struct *work)
 		goto out_rearm;
 	}
 
+	/*
+	 * New request retired after this work handler started, extend active
+	 * period until next instance of the work.
+	 */
+	if (work_pending(work))
+		goto out_unlock;
+
 	if (dev_priv->gt.active_requests)
 		goto out_unlock;
 
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-11-07  8:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-05  8:35 [PATCH v4 1/3] drm/i915: Avoid early GPU idling due to race with new request Imre Deak
2016-11-05  8:36 ` [PATCH v4 2/3] drm/i915: Make sure engines are idle during GPU idling in LR mode Imre Deak
2016-11-05 18:36   ` Chris Wilson
2016-11-05  8:36 ` [PATCH v4 3/3] drm/i915: Add assert for no pending GPU requests during suspend/resume " Imre Deak
2016-11-05  9:16 ` ✗ Fi.CI.BAT: failure for series starting with [v4,1/3] drm/i915: Avoid early GPU idling due to race with new request Patchwork
2016-11-05 18:35 ` [PATCH v4 1/3] " Chris Wilson
2016-11-07  8:25   ` Imre Deak

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.