aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests/mock_gem_device.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-06-12 09:52:46 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-06-12 12:06:11 +0100
commit33df8a7697a08ec96811a1e9bbce45c7cdbbc316 (patch)
tree68c4739164b54339de55ee5bb7f3a480f97c953a /drivers/gpu/drm/i915/selftests/mock_gem_device.c
parentdrm/i915: Add a label for config DRM_I915_SPIN_REQUEST (diff)
downloadlinux-dev-33df8a7697a08ec96811a1e9bbce45c7cdbbc316.tar.xz
linux-dev-33df8a7697a08ec96811a1e9bbce45c7cdbbc316.zip
drm/i915: Prevent lock-cycles between GPU waits and GPU resets
We cannot allow ourselves to wait on the GPU while holding any lock as we may need to reset the GPU. While there is not an explicit lock between the two operations, lockdep cannot detect the dependency. So let's tell lockdep about the wait/reset dependency with an explicit lockmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190612085246.16374-1-chris@chris-wilson.co.uk
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/i915/selftests/mock_gem_device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index b7f3fbb4ae89..1e9ffced78c1 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -130,6 +130,7 @@ static struct dev_pm_domain pm_domain = {
struct drm_i915_private *mock_gem_device(void)
{
+ static struct lock_class_key reset_key;
struct drm_i915_private *i915;
struct pci_dev *pdev;
int err;
@@ -204,6 +205,7 @@ struct drm_i915_private *mock_gem_device(void)
INIT_LIST_HEAD(&i915->gt.active_rings);
INIT_LIST_HEAD(&i915->gt.closed_vma);
spin_lock_init(&i915->gt.closed_lock);
+ lockdep_init_map(&i915->gt.reset_lockmap, "i915.reset", &reset_key, 0);
mutex_lock(&i915->drm.struct_mutex);