]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Lock out execlist tasklet while peeking inside for busy-stats
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jan 2018 09:20:41 +0000 (09:20 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jan 2018 12:18:46 +0000 (12:18 +0000)
commit5a100d1f5e214348d394d64c7034cb99f405c3af
treec50938826482ecf2a3d9386a319dc9ea1f354e69
parente1aac9cf82eaf3eeaeae5fdf5090bedd3919e25d
drm/i915: Lock out execlist tasklet while peeking inside for busy-stats

In order to prevent a race condition where we may end up overaccounting
the active state and leaving the busy-stats believing the GPU is 100%
busy, lock out the tasklet while we reconstruct the busy state. There is
no direct spinlock guard for the execlists->port[], so we need to
utilise tasklet_disable() as a synchronous barrier to prevent it, the
only writer to execlists->port[], from running at the same time as the
enable.

Fixes: ccf362448b71 ("drm/i915/pmu: Reconstruct active state on starting busy-stats")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180115092041.13509-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/intel_engine_cs.c