drm/i915/execlists: Use a locked clear_bit() for synchronisation with interrupt
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 21 Mar 2018 09:10:27 +0000 (09:10 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 21 Mar 2018 17:08:26 +0000 (17:08 +0000)
commit9153e6b7c85edbc89e874e5c83f86217c53dcfaf
treedbb86edb8fe9fe52cdf65af785a8e951735d2cea
parentd871bfd0089f50e3010f361e804d290abe67119c
drm/i915/execlists: Use a locked clear_bit() for synchronisation with interrupt

We were relying on the uncached reads when processing the CSB to provide
ourselves with the serialisation with the interrupt handler (so we could
detect new interrupts in the middle of processing the old one). However,
in commit 767a983ab255 ("drm/i915/execlists: Read the context-status HEAD
from the HWSP") those uncached reads were eliminated (on one path at
least) and along with them our serialisation. The result is that we
would very rarely miss notification of a new interrupt and leave a
context-switch unprocessed, hanging the GPU.

Fixes: 767a983ab255 ("drm/i915/execlists: Read the context-status HEAD from the HWSP")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180321091027.21034-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_lrc.c