From c3ca5465564e7b6459e868b3433fff4e44a7fd64 Mon Sep 17 00:00:00 2001 From: Matthew Brost Date: Wed, 25 Jan 2023 15:27:21 -0800 Subject: [PATCH] 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 --- drivers/gpu/drm/xe/xe_bo_evict.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c index 7046dc203138..3fb3c8c77efa 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 -- 2.25.1