From b9777c6f86ac8c21f82211ab982ca48302042ede Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 9 May 2018 07:59:26 +0100 Subject: [PATCH] drm/i915/selftests: Only switch to kernel context when locked In igt_flush_test() we try to switch back to the kernel context, but we are only able to do so when we are called with struct_mutex held. More of my CI fallout from lockdep being temporarily suppressed :( Fixes: 4cdf65ce8cc2 ("drm/i915/selftests: Return to kernel context after each test") Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20180509065926.19207-1-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/selftests/igt_flush_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/igt_flush_test.c b/drivers/gpu/drm/i915/selftests/igt_flush_test.c index 7f35bdd..0d06f55 100644 --- a/drivers/gpu/drm/i915/selftests/igt_flush_test.c +++ b/drivers/gpu/drm/i915/selftests/igt_flush_test.c @@ -57,7 +57,8 @@ int igt_flush_test(struct drm_i915_private *i915, unsigned int flags) cond_resched(); - if (i915_gem_switch_to_kernel_context(i915)) { + if (flags & I915_WAIT_LOCKED && + i915_gem_switch_to_kernel_context(i915)) { pr_err("Failed to switch back to kernel context; declaring wedged\n"); i915_gem_set_wedged(i915); } -- 2.7.4