Commit c8f0c2d4 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2022-05-12' of...

Merge tag 'drm-intel-fixes-2022-05-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

Fix for #5732: (Cc stable) kernel memory corruption when running a lot of OpenCL tests in parallel
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/YnykW6L4e7vD3yl3@jlahtine-mobl.ger.corp.intel.com
parents c5eb0a61 3220c3b2
...@@ -1605,17 +1605,17 @@ void i915_vma_close(struct i915_vma *vma) ...@@ -1605,17 +1605,17 @@ void i915_vma_close(struct i915_vma *vma)
static void __i915_vma_remove_closed(struct i915_vma *vma) static void __i915_vma_remove_closed(struct i915_vma *vma)
{ {
struct intel_gt *gt = vma->vm->gt;
spin_lock_irq(&gt->closed_lock);
list_del_init(&vma->closed_link); list_del_init(&vma->closed_link);
spin_unlock_irq(&gt->closed_lock);
} }
void i915_vma_reopen(struct i915_vma *vma) void i915_vma_reopen(struct i915_vma *vma)
{ {
struct intel_gt *gt = vma->vm->gt;
spin_lock_irq(&gt->closed_lock);
if (i915_vma_is_closed(vma)) if (i915_vma_is_closed(vma))
__i915_vma_remove_closed(vma); __i915_vma_remove_closed(vma);
spin_unlock_irq(&gt->closed_lock);
} }
void i915_vma_release(struct kref *ref) void i915_vma_release(struct kref *ref)
...@@ -1641,6 +1641,7 @@ static void force_unbind(struct i915_vma *vma) ...@@ -1641,6 +1641,7 @@ static void force_unbind(struct i915_vma *vma)
static void release_references(struct i915_vma *vma) static void release_references(struct i915_vma *vma)
{ {
struct drm_i915_gem_object *obj = vma->obj; struct drm_i915_gem_object *obj = vma->obj;
struct intel_gt *gt = vma->vm->gt;
GEM_BUG_ON(i915_vma_is_active(vma)); GEM_BUG_ON(i915_vma_is_active(vma));
...@@ -1650,7 +1651,9 @@ static void release_references(struct i915_vma *vma) ...@@ -1650,7 +1651,9 @@ static void release_references(struct i915_vma *vma)
rb_erase(&vma->obj_node, &obj->vma.tree); rb_erase(&vma->obj_node, &obj->vma.tree);
spin_unlock(&obj->vma.lock); spin_unlock(&obj->vma.lock);
spin_lock_irq(&gt->closed_lock);
__i915_vma_remove_closed(vma); __i915_vma_remove_closed(vma);
spin_unlock_irq(&gt->closed_lock);
__i915_vma_put(vma); __i915_vma_put(vma);
} }
......
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