intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Park the signaler before sleeping
@ 2017-04-03 10:51 Chris Wilson
  2017-04-03 11:07 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-04-04  9:57 ` [PATCH] " Tvrtko Ursulin
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-04-03 10:51 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

If the signal to park arrives before we sleep, then we need to check
kthread_should_park() before sleeping to avoid missing the signal.
Otherwise, if the signal arrives whilst we are processing completed
requests, we will reset the current->state back to TASK_INTERRUPTIBLE
and so miss the wakeup.

Fixes: fe3288b5da2c ("drm/i915: Park the breadcrumbs signaler across a GPU reset")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index b6ea192ad550..308c56a021ab 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -629,6 +629,9 @@ static int intel_breadcrumbs_signaler(void *arg)
 		} else {
 			DEFINE_WAIT(exec);
 
+			if (kthread_should_park())
+				kthread_parkme();
+
 			if (kthread_should_stop()) {
 				GEM_BUG_ON(request);
 				break;
@@ -641,9 +644,6 @@ static int intel_breadcrumbs_signaler(void *arg)
 
 			if (request)
 				remove_wait_queue(&request->execute, &exec);
-
-			if (kthread_should_park())
-				kthread_parkme();
 		}
 		i915_gem_request_put(request);
 	} while (1);
-- 
2.11.0

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

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

end of thread, other threads:[~2017-04-04 12:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-03 10:51 [PATCH] drm/i915: Park the signaler before sleeping Chris Wilson
2017-04-03 11:07 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-04  9:57 ` [PATCH] " Tvrtko Ursulin
2017-04-04 12:28   ` Chris Wilson

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).