drm/i915: Park the signaler before sleeping
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 3 Apr 2017 10:51:24 +0000 (11:51 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 4 Apr 2017 10:03:33 +0000 (11:03 +0100)
commitb1becb88268beb72df6495e35d3d76c138d215bb
tree96842133a2630ea8d862733a2c4e2768e55f16c7
parent7a3ee5deb46e1350b2c290d2b1fe0a2bc4087bff
drm/i915: Park the signaler before sleeping

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>
Link: http://patchwork.freedesktop.org/patch/msgid/20170403105124.8969-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/intel_breadcrumbs.c