]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Lock GGTT on when restoring kernel BOs
authorMatthew Brost <matthew.brost@intel.com>
Wed, 25 Jan 2023 23:27:21 +0000 (15:27 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:27:47 +0000 (18:27 -0500)
Make lockdep happy as we required to hold the GGTT when calling
xe_ggtt_map_bo.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
drivers/gpu/drm/xe/xe_bo_evict.c

index 7046dc203138f68a43b780a3de1a74a0c00dd6f0..3fb3c8c77efa9969c37f13a3ba3853c61bf932d1 100644 (file)
@@ -147,8 +147,11 @@ int xe_bo_restore_kernel(struct xe_device *xe)
                        return ret;
                }
 
-               if (bo->flags & XE_BO_CREATE_GGTT_BIT)
+               if (bo->flags & XE_BO_CREATE_GGTT_BIT) {
+                       mutex_lock(&bo->gt->mem.ggtt->lock);
                        xe_ggtt_map_bo(bo->gt->mem.ggtt, bo);
+                       mutex_unlock(&bo->gt->mem.ggtt->lock);
+               }
 
                /*
                 * We expect validate to trigger a move VRAM and our move code