OSDN Git Service

drm/i915: Use full serialisation around engine->irq_posted
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 22 Mar 2018 07:35:32 +0000 (07:35 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 22 Mar 2018 20:34:46 +0000 (20:34 +0000)
commit1c645bf4378f1539df57c6228f5c4957c130324a
treecf0edb309fdf433ef127c4ef0c3260f232bb26db
parenta90507d60763ee1067cf217614a8bb2ab43aca1a
drm/i915: Use full serialisation around engine->irq_posted

Using engine->irq_posted for execlists, we are not always serialised by
the tasklet as we supposed. On the reset paths, the tasklet is disabled
and ignored. Instead, we manipulate the engine->irq_posted directly to
account for the reset, but if an interrupt fired before the reset and so
wrote to engine->irq_posted, that write may not be flushed from the
local CPU's cacheline until much later as the tasklet is already active
and so does not generate a mb(). To correctly serialise the interrupt
with reset, we need serialisation on the set_bit() itself.

And at last Mika can be happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
CC: Michel Thierry <michel.thierry@intel.com>
Cc: Jeff McGee <jeff.mcgee@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Jeff McGee <jeff.mcgee@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322073533.5313-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_irq.c