Commit 1f6f0023 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Drop struct_mutex around lowlevel pggtt allocation

For a ppgtt that we are constructing, there is no struct_mutex
dependence so skip it. In the process, also ping the scheduler
frequently to try and avoid the NMI watchdog.

v2: gen6 requires struct_mutex to clean up (currently)
Suggested-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=107094Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703135331.12265-1-chris@chris-wilson.co.uk
parent 38b7fb0b
...@@ -156,12 +156,9 @@ static int igt_ppgtt_alloc(void *arg) ...@@ -156,12 +156,9 @@ static int igt_ppgtt_alloc(void *arg)
if (!USES_PPGTT(dev_priv)) if (!USES_PPGTT(dev_priv))
return 0; return 0;
mutex_lock(&dev_priv->drm.struct_mutex);
ppgtt = __hw_ppgtt_create(dev_priv); ppgtt = __hw_ppgtt_create(dev_priv);
if (IS_ERR(ppgtt)) { if (IS_ERR(ppgtt))
err = PTR_ERR(ppgtt); return PTR_ERR(ppgtt);
goto err_unlock;
}
if (!ppgtt->vm.allocate_va_range) if (!ppgtt->vm.allocate_va_range)
goto err_ppgtt_cleanup; goto err_ppgtt_cleanup;
...@@ -180,6 +177,8 @@ static int igt_ppgtt_alloc(void *arg) ...@@ -180,6 +177,8 @@ static int igt_ppgtt_alloc(void *arg)
goto err_ppgtt_cleanup; goto err_ppgtt_cleanup;
} }
cond_resched();
ppgtt->vm.clear_range(&ppgtt->vm, 0, size); ppgtt->vm.clear_range(&ppgtt->vm, 0, size);
} }
...@@ -197,13 +196,15 @@ static int igt_ppgtt_alloc(void *arg) ...@@ -197,13 +196,15 @@ static int igt_ppgtt_alloc(void *arg)
} }
goto err_ppgtt_cleanup; goto err_ppgtt_cleanup;
} }
cond_resched();
} }
err_ppgtt_cleanup: err_ppgtt_cleanup:
mutex_lock(&dev_priv->drm.struct_mutex);
ppgtt->vm.cleanup(&ppgtt->vm); ppgtt->vm.cleanup(&ppgtt->vm);
kfree(ppgtt);
err_unlock:
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
kfree(ppgtt);
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