From: Matthew Brost Date: Wed, 25 Jan 2023 23:27:21 +0000 (-0800) Subject: drm/xe: Lock GGTT on when restoring kernel BOs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c3ca5465564e7b6459e868b3433fff4e44a7fd64;p=linux.git drm/xe: Lock GGTT on when restoring kernel BOs Make lockdep happy as we required to hold the GGTT when calling xe_ggtt_map_bo. Signed-off-by: Matthew Brost Signed-off-by: Rodrigo Vivi Reviewed-by: Niranjana Vishwanathapura --- diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index 7046dc203138f..3fb3c8c77efa9 100644 --- a/drivers/gpu/drm/xe/xe_bo_evict.c +++ b/drivers/gpu/drm/xe/xe_bo_evict.c @@ -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