public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v1] drm/xe: Drop dma mappings for wedged device
@ 2026-03-24  7:13 Raag Jadav
  2026-03-24  7:25 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Raag Jadav @ 2026-03-24  7:13 UTC (permalink / raw)
  To: intel-xe
  Cc: matthew.brost, thomas.hellstrom, matthew.auld,
	himal.prasad.ghimiray, matthew.d.roper, Raag Jadav

As per uapi documentation[1], the prerequisite for wedged device is to
drop all dma mappings. Reuse xe_bo_pci_dev_remove_pinned() for this,
which iterates over external bo list and removes all dma mappings.

[1] Documentation/gpu/drm-uapi.rst

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
PS: This is pretty much uncharted territory for me, so please consider
this an RFC.

 drivers/gpu/drm/xe/xe_bo_evict.c | 8 +++++++-
 drivers/gpu/drm/xe/xe_bo_evict.h | 1 +
 drivers/gpu/drm/xe/xe_device.c   | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c
index 7661fca7f278..f741cda50b2d 100644
--- a/drivers/gpu/drm/xe/xe_bo_evict.c
+++ b/drivers/gpu/drm/xe/xe_bo_evict.c
@@ -270,7 +270,13 @@ int xe_bo_restore_late(struct xe_device *xe)
 	return ret;
 }
 
-static void xe_bo_pci_dev_remove_pinned(struct xe_device *xe)
+/**
+ * xe_bo_pci_dev_remove_pinned() - Unmap external bos
+ * @xe: xe device
+ *
+ * Drop dma mappings of all external pinned bos.
+ */
+void xe_bo_pci_dev_remove_pinned(struct xe_device *xe)
 {
 	struct xe_tile *tile;
 	unsigned int id;
diff --git a/drivers/gpu/drm/xe/xe_bo_evict.h b/drivers/gpu/drm/xe/xe_bo_evict.h
index e8385cb7f5e9..6ce27e272780 100644
--- a/drivers/gpu/drm/xe/xe_bo_evict.h
+++ b/drivers/gpu/drm/xe/xe_bo_evict.h
@@ -15,6 +15,7 @@ void xe_bo_notifier_unprepare_all_pinned(struct xe_device *xe);
 int xe_bo_restore_early(struct xe_device *xe);
 int xe_bo_restore_late(struct xe_device *xe);
 
+void xe_bo_pci_dev_remove_pinned(struct xe_device *xe);
 void xe_bo_pci_dev_remove_all(struct xe_device *xe);
 
 int xe_bo_pinned_init(struct xe_device *xe);
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 207ad2eea412..ac51b04560df 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1351,6 +1351,8 @@ void xe_device_declare_wedged(struct xe_device *xe)
 	for_each_gt(gt, xe, id)
 		xe_gt_declare_wedged(gt);
 
+	xe_bo_pci_dev_remove_pinned(xe);
+
 	if (xe_device_wedged(xe)) {
 		/*
 		 * XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET is intended for debugging
-- 
2.43.0


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

end of thread, other threads:[~2026-03-25 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24  7:13 [PATCH v1] drm/xe: Drop dma mappings for wedged device Raag Jadav
2026-03-24  7:25 ` ✓ CI.KUnit: success for " Patchwork
2026-03-24  8:25 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-24 12:52 ` [PATCH v1] " Matthew Auld
2026-03-24 15:14   ` Raag Jadav
2026-03-24 15:37     ` Matthew Auld
2026-03-25 19:37       ` Raag Jadav
2026-03-24 15:31 ` ✗ Xe.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