summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_engine_cs.c
diff options
context:
space:
mode:
authorChris Wilson2018-07-13 22:35:28 +0200
committerChris Wilson2018-07-13 23:32:20 +0200
commit9701975e851082d179faaab9c6306a7800d86c0f (patch)
treec86e5260918def9edae460cadef3ad0052a6bf73 /drivers/gpu/drm/i915/intel_engine_cs.c
parentdrm/i915/selftests: Include the start of each subtest in the GEM trace (diff)
downloadkernel-qcow2-linux-9701975e851082d179faaab9c6306a7800d86c0f.tar.gz
kernel-qcow2-linux-9701975e851082d179faaab9c6306a7800d86c0f.tar.xz
kernel-qcow2-linux-9701975e851082d179faaab9c6306a7800d86c0f.zip
drm/i915: Do not short-circuit tasklets during reset
Inside intel_engine_is_idle(), we flush the tasklet to ensure that is being run in a timely fashion (ksoftirqd has taught us to expect the worst). However, if we are in the middle of reset, the HW may not yet be ready to execute the submission tasklet and so we must respect the disable flag. Fixes: dd0cf235d81f ("drm/i915: Speed up idle detection by kicking the tasklets") Testcase: igt/drv_selftest/live_hangcheck Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Michel Thierry <michel.thierry@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180713203529.1973-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_engine_cs.c')
-rw-r--r--drivers/gpu/drm/i915/intel_engine_cs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 220050107c48..2d1952849d69 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -989,16 +989,18 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine)
/* Waiting to drain ELSP? */
if (READ_ONCE(engine->execlists.active)) {
- struct intel_engine_execlists *execlists = &engine->execlists;
+ struct tasklet_struct *t = &engine->execlists.tasklet;
local_bh_disable();
- if (tasklet_trylock(&execlists->tasklet)) {
- execlists->tasklet.func(execlists->tasklet.data);
- tasklet_unlock(&execlists->tasklet);
+ if (tasklet_trylock(t)) {
+ /* Must wait for any GPU reset in progress. */
+ if (__tasklet_is_enabled(t))
+ t->func(t->data);
+ tasklet_unlock(t);
}
local_bh_enable();
- if (READ_ONCE(execlists->active))
+ if (READ_ONCE(engine->execlists.active))
return false;
}