Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Take ref to VM in delayed snapshot
@ 2024-07-25 23:24 Matthew Brost
  2024-07-26  0:09 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Matthew Brost @ 2024-07-25 23:24 UTC (permalink / raw)
  To: intel-xe; +Cc: paulo.r.zanoni, maarten.lankhorst

Kernel BO's don't take a ref to the VM, we need to the VM for the
delayed snapshot, so take a ref to the VM in delayed snapshot.

47058633d9c5 ("drm/xe: Move lrc snapshot capturing to xe_lrc.c")
Cc: Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_lrc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
index 94ff62e1d95e..9ef9b45a3596 100644
--- a/drivers/gpu/drm/xe/xe_lrc.c
+++ b/drivers/gpu/drm/xe/xe_lrc.c
@@ -1634,6 +1634,8 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)
 	if (!snapshot)
 		return NULL;
 
+	xe_vm_get(lrc->bo->vm);
+
 	snapshot->context_desc = xe_lrc_ggtt_addr(lrc);
 	snapshot->indirect_context_desc = xe_lrc_indirect_ring_ggtt_addr(lrc);
 	snapshot->head = xe_lrc_ring_head(lrc);
@@ -1653,12 +1655,14 @@ struct xe_lrc_snapshot *xe_lrc_snapshot_capture(struct xe_lrc *lrc)
 void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
 {
 	struct xe_bo *bo;
+	struct xe_vm *vm;
 	struct iosys_map src;
 
 	if (!snapshot)
 		return;
 
 	bo = snapshot->lrc_bo;
+	vm = bo->vm;
 	snapshot->lrc_bo = NULL;
 
 	snapshot->lrc_snapshot = kvmalloc(snapshot->lrc_size, GFP_KERNEL);
@@ -1678,6 +1682,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
 	xe_bo_unlock(bo);
 put_bo:
 	xe_bo_put(bo);
+	xe_vm_put(vm);
 }
 
 void xe_lrc_snapshot_print(struct xe_lrc_snapshot *snapshot, struct drm_printer *p)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-07-26 12:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 23:24 [PATCH] drm/xe: Take ref to VM in delayed snapshot Matthew Brost
2024-07-26  0:09 ` ✓ CI.Patch_applied: success for " Patchwork
2024-07-26  0:10 ` ✗ CI.checkpatch: warning " Patchwork
2024-07-26  0:11 ` ✓ CI.KUnit: success " Patchwork
2024-07-26  0:23 ` ✓ CI.Build: " Patchwork
2024-07-26  0:26 ` ✓ CI.Hooks: " Patchwork
2024-07-26  0:28 ` ✓ CI.checksparse: " Patchwork
2024-07-26  0:51 ` ✗ CI.BAT: failure " Patchwork
2024-07-26 12:36   ` Matthew Brost
2024-07-26  8:17 ` [PATCH] " Upadhyay, Tejas
2024-07-26 12:13   ` Matthew Brost
2024-07-26  9:27 ` ✗ CI.FULL: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox