drm/i915/selftests: Avoid repeatedly harming the same innocent context
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 30 Mar 2018 13:18:01 +0000 (14:18 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Apr 2018 09:42:18 +0000 (10:42 +0100)
commit028666793a0291b63eb61bae7252345821326a1b
tree5f5a66e6bb55a695d786ed9cf6e75dfb22d47712
parentb651bd2a3ae33f6a98d6ea36ef2518f5211bdc4f
drm/i915/selftests: Avoid repeatedly harming the same innocent context

We don't handle resetting the kernel context very well, or presumably any
context executing its breadcrumb commands in the ring as opposed to the
batchbuffer and flush. If we trigger a device reset twice in quick
succession while the kernel context is executing, we may end up skipping
the breadcrumb.  This is really only a problem for the selftest as
normally there is a large interlude between resets (hangcheck), or we
focus on resetting just one engine and so avoid repeatedly resetting
innocents.

Something to try would be a preempt-to-idle to quiesce the engine before
reset, so that innocent contexts would be spared the reset.

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