Commit 2af40298 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Drop vestigal struct_mutex guards

We no longer need struct_mutex to serialise request emission, so remove
it from the gt selftests.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-20-chris@chris-wilson.co.uk
parent 3d88f76d
...@@ -1639,7 +1639,6 @@ int i915_gem_huge_page_mock_selftests(void) ...@@ -1639,7 +1639,6 @@ int i915_gem_huge_page_mock_selftests(void)
mkwrite_device_info(dev_priv)->ppgtt_type = INTEL_PPGTT_FULL; mkwrite_device_info(dev_priv)->ppgtt_type = INTEL_PPGTT_FULL;
mkwrite_device_info(dev_priv)->ppgtt_size = 48; mkwrite_device_info(dev_priv)->ppgtt_size = 48;
mutex_lock(&dev_priv->drm.struct_mutex);
ppgtt = i915_ppgtt_create(dev_priv); ppgtt = i915_ppgtt_create(dev_priv);
if (IS_ERR(ppgtt)) { if (IS_ERR(ppgtt)) {
err = PTR_ERR(ppgtt); err = PTR_ERR(ppgtt);
...@@ -1665,9 +1664,7 @@ int i915_gem_huge_page_mock_selftests(void) ...@@ -1665,9 +1664,7 @@ int i915_gem_huge_page_mock_selftests(void)
i915_vm_put(&ppgtt->vm); i915_vm_put(&ppgtt->vm);
out_unlock: out_unlock:
mutex_unlock(&dev_priv->drm.struct_mutex);
drm_dev_put(&dev_priv->drm); drm_dev_put(&dev_priv->drm);
return err; return err;
} }
...@@ -1684,7 +1681,6 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915) ...@@ -1684,7 +1681,6 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
struct drm_file *file; struct drm_file *file;
struct i915_gem_context *ctx; struct i915_gem_context *ctx;
struct i915_address_space *vm; struct i915_address_space *vm;
intel_wakeref_t wakeref;
int err; int err;
if (!HAS_PPGTT(i915)) { if (!HAS_PPGTT(i915)) {
...@@ -1699,13 +1695,10 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915) ...@@ -1699,13 +1695,10 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
if (IS_ERR(file)) if (IS_ERR(file))
return PTR_ERR(file); return PTR_ERR(file);
mutex_lock(&i915->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
ctx = live_context(i915, file); ctx = live_context(i915, file);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
err = PTR_ERR(ctx); err = PTR_ERR(ctx);
goto out_unlock; goto out_file;
} }
mutex_lock(&ctx->mutex); mutex_lock(&ctx->mutex);
...@@ -1716,11 +1709,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915) ...@@ -1716,11 +1709,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
err = i915_subtests(tests, ctx); err = i915_subtests(tests, ctx);
out_unlock: out_file:
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
mutex_unlock(&i915->drm.struct_mutex);
mock_file_free(i915, file); mock_file_free(i915, file);
return err; return err;
} }
...@@ -307,9 +307,7 @@ static int live_parallel_switch(void *arg) ...@@ -307,9 +307,7 @@ static int live_parallel_switch(void *arg)
struct igt_live_test t; struct igt_live_test t;
int n; int n;
mutex_lock(&i915->drm.struct_mutex);
err = igt_live_test_begin(&t, i915, __func__, ""); err = igt_live_test_begin(&t, i915, __func__, "");
mutex_unlock(&i915->drm.struct_mutex);
if (err) if (err)
break; break;
...@@ -341,10 +339,8 @@ static int live_parallel_switch(void *arg) ...@@ -341,10 +339,8 @@ static int live_parallel_switch(void *arg)
data[n].tsk = NULL; data[n].tsk = NULL;
} }
mutex_lock(&i915->drm.struct_mutex);
if (igt_live_test_end(&t)) if (igt_live_test_end(&t))
err = -EIO; err = -EIO;
mutex_unlock(&i915->drm.struct_mutex);
} }
out: out:
......
...@@ -669,9 +669,7 @@ static int igt_mmap_offset_exhaustion(void *arg) ...@@ -669,9 +669,7 @@ static int igt_mmap_offset_exhaustion(void *arg)
goto out; goto out;
} }
mutex_lock(&i915->drm.struct_mutex);
err = make_obj_busy(obj); err = make_obj_busy(obj);
mutex_unlock(&i915->drm.struct_mutex);
if (err) { if (err) {
pr_err("[loop %d] Failed to busy the object\n", loop); pr_err("[loop %d] Failed to busy the object\n", loop);
goto err_obj; goto err_obj;
......
...@@ -25,9 +25,7 @@ static int mock_phys_object(void *arg) ...@@ -25,9 +25,7 @@ static int mock_phys_object(void *arg)
goto out; goto out;
} }
mutex_lock(&i915->drm.struct_mutex);
err = i915_gem_object_attach_phys(obj, PAGE_SIZE); err = i915_gem_object_attach_phys(obj, PAGE_SIZE);
mutex_unlock(&i915->drm.struct_mutex);
if (err) { if (err) {
pr_err("i915_gem_object_attach_phys failed, err=%d\n", err); pr_err("i915_gem_object_attach_phys failed, err=%d\n", err);
goto out_obj; goto out_obj;
......
This diff is collapsed.
...@@ -708,9 +708,7 @@ static int live_dirty_whitelist(void *arg) ...@@ -708,9 +708,7 @@ static int live_dirty_whitelist(void *arg)
wakeref = intel_runtime_pm_get(&i915->runtime_pm); wakeref = intel_runtime_pm_get(&i915->runtime_pm);
mutex_unlock(&i915->drm.struct_mutex);
file = mock_file(i915); file = mock_file(i915);
mutex_lock(&i915->drm.struct_mutex);
if (IS_ERR(file)) { if (IS_ERR(file)) {
err = PTR_ERR(file); err = PTR_ERR(file);
goto out_rpm; goto out_rpm;
...@@ -732,9 +730,7 @@ static int live_dirty_whitelist(void *arg) ...@@ -732,9 +730,7 @@ static int live_dirty_whitelist(void *arg)
} }
out_file: out_file:
mutex_unlock(&i915->drm.struct_mutex);
mock_file_free(i915, file); mock_file_free(i915, file);
mutex_lock(&i915->drm.struct_mutex);
out_rpm: out_rpm:
intel_runtime_pm_put(&i915->runtime_pm, wakeref); intel_runtime_pm_put(&i915->runtime_pm, wakeref);
return err; return err;
...@@ -1274,14 +1270,9 @@ int intel_workarounds_live_selftests(struct drm_i915_private *i915) ...@@ -1274,14 +1270,9 @@ int intel_workarounds_live_selftests(struct drm_i915_private *i915)
SUBTEST(live_gpu_reset_workarounds), SUBTEST(live_gpu_reset_workarounds),
SUBTEST(live_engine_reset_workarounds), SUBTEST(live_engine_reset_workarounds),
}; };
int err;
if (intel_gt_is_wedged(&i915->gt)) if (intel_gt_is_wedged(&i915->gt))
return 0; return 0;
mutex_lock(&i915->drm.struct_mutex); return i915_subtests(tests, i915);
err = i915_subtests(tests, i915);
mutex_unlock(&i915->drm.struct_mutex);
return err;
} }
...@@ -116,7 +116,6 @@ static int igt_guc_clients(void *args) ...@@ -116,7 +116,6 @@ static int igt_guc_clients(void *args)
int err = 0; int err = 0;
GEM_BUG_ON(!HAS_GT_UC(dev_priv)); GEM_BUG_ON(!HAS_GT_UC(dev_priv));
mutex_lock(&dev_priv->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
guc = &dev_priv->gt.uc.guc; guc = &dev_priv->gt.uc.guc;
...@@ -190,7 +189,6 @@ static int igt_guc_clients(void *args) ...@@ -190,7 +189,6 @@ static int igt_guc_clients(void *args)
guc_clients_enable(guc); guc_clients_enable(guc);
unlock: unlock:
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
mutex_unlock(&dev_priv->drm.struct_mutex);
return err; return err;
} }
...@@ -208,7 +206,6 @@ static int igt_guc_doorbells(void *arg) ...@@ -208,7 +206,6 @@ static int igt_guc_doorbells(void *arg)
u16 db_id; u16 db_id;
GEM_BUG_ON(!HAS_GT_UC(dev_priv)); GEM_BUG_ON(!HAS_GT_UC(dev_priv));
mutex_lock(&dev_priv->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
guc = &dev_priv->gt.uc.guc; guc = &dev_priv->gt.uc.guc;
...@@ -299,7 +296,6 @@ static int igt_guc_doorbells(void *arg) ...@@ -299,7 +296,6 @@ static int igt_guc_doorbells(void *arg)
} }
unlock: unlock:
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
mutex_unlock(&dev_priv->drm.struct_mutex);
return err; return err;
} }
......
...@@ -1797,7 +1797,6 @@ static int igt_cs_tlb(void *arg) ...@@ -1797,7 +1797,6 @@ static int igt_cs_tlb(void *arg)
if (IS_ERR(file)) if (IS_ERR(file))
return PTR_ERR(file); return PTR_ERR(file);
mutex_lock(&i915->drm.struct_mutex);
ctx = live_context(i915, file); ctx = live_context(i915, file);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
err = PTR_ERR(ctx); err = PTR_ERR(ctx);
...@@ -2020,7 +2019,6 @@ static int igt_cs_tlb(void *arg) ...@@ -2020,7 +2019,6 @@ static int igt_cs_tlb(void *arg)
out_vm: out_vm:
i915_vm_put(vm); i915_vm_put(vm);
out_unlock: out_unlock:
mutex_unlock(&i915->drm.struct_mutex);
mock_file_free(i915, file); mock_file_free(i915, file);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment