]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gvt: more locking for ppgtt mm LRU list
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Mon, 3 Feb 2020 15:07:01 +0000 (15:07 +0000)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 10 Feb 2020 02:04:34 +0000 (10:04 +0800)
When the lock was introduced in commit 5140baad9a8cf ("drm/i915/gvt: Add mutual
lock for ppgtt mm LRU list") one place got lost.

Fixes: 5140baad9a8c ("drm/i915/gvt: Add mutual lock for ppgtt mm LRU list")
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1580742421-25194-1-git-send-email-igor.druzhinin@citrix.com
drivers/gpu/drm/i915/gvt/gtt.c

index 4b04af569c05c13df7cc4f6ca235abb0b281d025..7dc7bb850d0a67df92e47f74ef31232e329a68d3 100644 (file)
@@ -1956,7 +1956,11 @@ void _intel_vgpu_mm_release(struct kref *mm_ref)
 
        if (mm->type == INTEL_GVT_MM_PPGTT) {
                list_del(&mm->ppgtt_mm.list);
+
+               mutex_lock(&mm->vgpu->gvt->gtt.ppgtt_mm_lock);
                list_del(&mm->ppgtt_mm.lru_list);
+               mutex_unlock(&mm->vgpu->gvt->gtt.ppgtt_mm_lock);
+
                invalidate_ppgtt_mm(mm);
        } else {
                vfree(mm->ggtt_mm.virtual_ggtt);