aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-06-26 14:44:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-06-26 16:03:13 +0100
commitd8474795665462dc7888711ae4b8888a4496eda8 (patch)
treed49020284e0d934e27eb97e2aaa3dee0088f4ec8 /drivers/gpu/drm/i915/gt/selftest_hangcheck.c
parentdrm/i915: Check backlight type while doing eDP backlight initializaiton (diff)
downloadwireguard-linux-d8474795665462dc7888711ae4b8888a4496eda8.tar.xz
wireguard-linux-d8474795665462dc7888711ae4b8888a4496eda8.zip
drm/i915/selftests: Serialise nop reset with retirement
In order for the reset count to be accurate across our selftest, we need to prevent the background retire worker from modifying our expected state. To preserve the intent of symmetry, we apply this to both i915_reset and i915_reset_engine, even though it strictly only affects i915_reset_engine currently. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190626134433.6318-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/selftest_hangcheck.c')
-rw-r--r--drivers/gpu/drm/i915/gt/selftest_hangcheck.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
index 3ceb397c8645..0e0b6c572ae9 100644
--- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
@@ -398,6 +398,7 @@ static int igt_reset_nop(void *arg)
count = 0;
do {
mutex_lock(&i915->drm.struct_mutex);
+
for_each_engine(engine, i915, id) {
int i;
@@ -413,11 +414,12 @@ static int igt_reset_nop(void *arg)
i915_request_add(rq);
}
}
- mutex_unlock(&i915->drm.struct_mutex);
igt_global_reset_lock(i915);
i915_reset(i915, ALL_ENGINES, NULL);
igt_global_reset_unlock(i915);
+
+ mutex_unlock(&i915->drm.struct_mutex);
if (i915_reset_failed(i915)) {
err = -EIO;
break;
@@ -511,9 +513,8 @@ static int igt_reset_nop_engine(void *arg)
i915_request_add(rq);
}
- mutex_unlock(&i915->drm.struct_mutex);
-
err = i915_reset_engine(engine, NULL);
+ mutex_unlock(&i915->drm.struct_mutex);
if (err) {
pr_err("i915_reset_engine failed\n");
break;