Skip to contentSkip to conversation

drm/xe: Isolate wedged devices from hardware access

PATCH Superseded Arvind Yadav 9 participants 52 messages Aug 27 – Sep 15

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover drm/xe: Isolate wedged devices from hardware access

A permanently wedged device can still access hardware through pending work, existing VRAM mappings and background driver paths. This can cause unwanted DMA or MMIO access while userspace is preparing device recovery.

This series separates temporary PCI error recovery from permanent wedging and introduces a common device-I/O-blocked state.

After a permanent wedge, the driver:
- stops queued VM, SVM and GuC work.
- shuts down the display.
- invalidates existing CPU mappings to VRAM.
- maps later CPU faults to a per-BO dummy page.
- stops interrupts and clears PCI bus mastering.
- rejects new VRAM allocations.
- notifies userspace only after isolation completes.
- drops queued page faults and stops VM, SVM and GuC work.

System suspend waits for wedge isolation to complete before skipping the normal suspend path. The worker cannot reach synchronize_srcu() until all GTs have been declared wedged and their pending fences have been signalled.

The device remains isolated until userspace performs the advertised recovery, such as driver rebind or bus reset.

The series also fixes IRQ uninstall so requested handlers are freed after interrupts have already been suspended.

Arvind Yadav (13):
drm/xe/irq: Always free requested IRQs on uninstall drm/xe: Separate AER reset state from device wedging drm/xe: Drop queued page faults when device I/O is blocked drm/xe: Stop VM work when device I/O is blocked drm/xe: Send wedged notification from a worker drm/xe: Reuse one dummy page per BO after wedge drm/xe: Invalidate existing VRAM mappings on wedge drm/xe/irq: Serialize IRQ suspend and resume drm/xe: Isolate a wedged device before notifying userspace drm/xe/ttm: Reject VRAM allocations on wedged devices drm/xe/guc: Skip timeout recovery on a wedged device drm/xe: Skip PM notifier preparation for wedged devices drm/xe: Block BO VM access when device I/O is unavailable

 drivers/gpu/drm/xe/display/xe_display.c |  18 +++-
 drivers/gpu/drm/xe/xe_bo.c              | 101 +++++++++++++++++++-
 drivers/gpu/drm/xe/xe_bo.h              |   1 +
 drivers/gpu/drm/xe/xe_bo_types.h        |   4 +
 drivers/gpu/drm/xe/xe_device.c          | 118 ++++++++++++++++++++----
 drivers/gpu/drm/xe/xe_device.h          |  12 +++
 drivers/gpu/drm/xe/xe_device_types.h    |  26 ++++++
 drivers/gpu/drm/xe/xe_guc_ct.c          |   4 +-
 drivers/gpu/drm/xe/xe_guc_pc.c          |  10 +-
 drivers/gpu/drm/xe/xe_guc_rc.c          |   4 +-
 drivers/gpu/drm/xe/xe_guc_submit.c      |  13 ++-
 drivers/gpu/drm/xe/xe_guc_tlb_inval.c   |   8 +-
 drivers/gpu/drm/xe/xe_irq.c             |  32 +++++--
 drivers/gpu/drm/xe/xe_pagefault.c       |  40 ++++++++
 drivers/gpu/drm/xe/xe_pci.c             |  23 ++++-
 drivers/gpu/drm/xe/xe_pci_error.c       |  22 ++---
 drivers/gpu/drm/xe/xe_pm.c              |  27 ++++++
 drivers/gpu/drm/xe/xe_sriov_pf.c        |   2 +-
 drivers/gpu/drm/xe/xe_svm.c             |  21 ++++-
 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c    |   4 +
 drivers/gpu/drm/xe/xe_vm.c              |  16 ++++
 21 files changed, 446 insertions(+), 60 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/13 drm/xe/irq: Always free requested IRQs on uninstall

xe_irq_suspend() clears irq.enabled after disabling and synchronizing the interrupts. irq_uninstall() currently returns when that flag is clear, so a suspended device can skip free_irq() during teardown.

The managed uninstall action is registered only after the IRQ request succeeds. Reset the interrupt registers only when interrupts are still enabled, but always free the requested IRQs.

Fixes 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_irq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_irq.c +2 -4
index 9e49e2241da4..d314993b14a1 100644
@@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
 {
 	struct xe_device *xe = arg;
 
-	if (!atomic_xchg(&xe->irq.enabled, 0))
-		return;
-
-	xe_irq_reset(xe);
+	if (atomic_xchg(&xe->irq.enabled, 0))
+		xe_irq_reset(xe);
 
 	if (xe_device_has_msix(xe))
 		xe_irq_msix_free(xe);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/13
#2 lore raw

Re: [PATCH 01/13] drm/xe/irq: Always free requested IRQs on uninstall

Quoted 9 lines · Arvind Yadav

xe_irq_suspend() clears irq.enabled after disabling and synchronizing the interrupts. irq_uninstall() currently returns when that flag is clear, so a suspended device can skip free_irq() during teardown.

The managed uninstall action is registered only after the IRQ request succeeds. Reset the interrupt registers only when interrupts are still enabled, but always free the requested IRQs.

Fixes 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")

Fixes seems incorrect, the early return was even before the change.

Quoted 15 lines
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_irq.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_irq.c +0 -0
index 9e49e2241da4..d314993b14a1 100644

drivers/gpu/drm/xe/xe_irq.c static void irq_uninstall(void *arg) · line 790

Quoted 9 lines
drivers/gpu/drm/xe/xe_irq.c +2 -4
@@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
  {
  	struct xe_device *xe = arg;
 
-	if (!atomic_xchg(&xe->irq.enabled, 0))
-		return;
-
-	xe_irq_reset(xe);
+	if (atomic_xchg(&xe->irq.enabled, 0))
+		xe_irq_reset(xe);

Patch looks correct. With correct fixes-tag:

Quoted 3 lines
drivers/gpu/drm/xe/xe_irq.c +0 -0
  	if (xe_device_has_msix(xe))
  		xe_irq_msix_free(xe);
maintainer
#3 lore raw

Re: [PATCH 01/13] drm/xe/irq: Always free requested IRQs on uninstall

Quoted 7 lines · Himal Prasad
Quoted 4 lines · Arvind Yadav

xe_irq_suspend() clears irq.enabled after disabling and synchronizing the interrupts. irq_uninstall() currently returns when that flag is clear, so a suspended device can skip free_irq() during teardown.

Quoted 7 lines
Quoted 5 lines

The managed uninstall action is registered only after the IRQ request succeeds. Reset the interrupt registers only when interrupts are still enabled, but always free the requested IRQs.

Fixes 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")

Fixes seems incorrect, the early return was even before the change.

right, apparently since the very beginning:

Fixes dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")

(I hate to use this initial as fixes nowadays, but it is the right one...)

Quoted 33 lines
Quoted 16 lines
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_irq.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_irq.c +0 -0
index 9e49e2241da4..d314993b14a1 100644

drivers/gpu/drm/xe/xe_irq.c static void irq_uninstall(void *arg) · line 789

Quoted 8 lines
drivers/gpu/drm/xe/xe_irq.c +2 -4
@@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
  {
  	struct xe_device *xe = arg;
-	if (!atomic_xchg(&xe->irq.enabled, 0))
-		return;
-
-	xe_irq_reset(xe);
+	if (atomic_xchg(&xe->irq.enabled, 0))
+		xe_irq_reset(xe);

Patch looks correct. With correct fixes-tag:

Quoted 2 lines
drivers/gpu/drm/xe/xe_irq.c +0 -0
  	if (xe_device_has_msix(xe))
  		xe_irq_msix_free(xe);
#4 lore raw

Re: [PATCH 01/13] drm/xe/irq: Always free requested IRQs on uninstall

Quoted 11 lines · Rodrigo Vivi
Quoted 10 lines · Himal Prasad
Quoted 8 lines · Arvind Yadav

xe_irq_suspend() clears irq.enabled after disabling and synchronizing the interrupts. irq_uninstall() currently returns when that flag is clear, so a suspended device can skip free_irq() during teardown.

The managed uninstall action is registered only after the IRQ request succeeds. Reset the interrupt registers only when interrupts are still enabled, but always free the requested IRQs.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line
Fixes 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")

Fixes seems incorrect, the early return was even before the change.

right, apparently since the very beginning:

Fixes dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")

(I hate to use this initial as fixes nowadays, but it is the right one...)

Thanks for sharing the correct Fixes tag.

~Arvind

Quoted 31 lines
Quoted 31 lines
Quoted 16 lines
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
   drivers/gpu/drm/xe/xe_irq.c | 6 ++----
   1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_irq.c +0 -0
index 9e49e2241da4..d314993b14a1 100644

drivers/gpu/drm/xe/xe_irq.c static void irq_uninstall(void *arg) · line 789

Quoted 8 lines
drivers/gpu/drm/xe/xe_irq.c +2 -4
@@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
   {
   	struct xe_device *xe = arg;
-	if (!atomic_xchg(&xe->irq.enabled, 0))
-		return;
-
-	xe_irq_reset(xe);
+	if (atomic_xchg(&xe->irq.enabled, 0))
+		xe_irq_reset(xe);

Patch looks correct. With correct fixes-tag:

Quoted 2 lines
drivers/gpu/drm/xe/xe_irq.c +0 -0
   	if (xe_device_has_msix(xe))
   		xe_irq_msix_free(xe);
maintainer Reviewed-by on v1 1/13
#5 lore raw

Re: [PATCH 01/13] drm/xe/irq: Always free requested IRQs on uninstall

In reply to Arvind Yadav
Quoted 11 lines · Arvind Yadav

xe_irq_suspend() clears irq.enabled after disabling and synchronizing the
interrupts. irq_uninstall() currently returns when that flag is clear, so
a suspended device can skip free_irq() during teardown.

The managed uninstall action is registered only after the IRQ request succeeds. Reset the interrupt registers only when interrupts are still
enabled, but always free the requested IRQs.

Quoted 7 lines
Fixes 4d79a1266d4c ("drm/xe: Make irq enabled flag atomic")
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
Quoted 25 lines

---
 drivers/gpu/drm/xe/xe_irq.c | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/xe_irq.c +0 -0
index 9e49e2241da4..d314993b14a1 100644
@@ -786,10 +786,8 @@ static void irq_uninstall(void *arg)
  {
  	struct xe_device *xe = arg;

drivers/gpu/drm/xe/xe_irq.c +2 -4
-	if (!atomic_xchg(&xe->irq.enabled, 0))
-		return;
-
-	xe_irq_reset(xe);
+	if (atomic_xchg(&xe->irq.enabled, 0))
+		xe_irq_reset(xe);

  if (xe_device_has_msix(xe))
  xe_irq_msix_free(xe);

#6 lore raw

PATCH 2/13 drm/xe: Separate AER reset state from device wedging

In reply to Arvind Yadav

PCI error recovery currently uses xe->wedged.flag to block driver access. This mixes a temporary AER reset with a permanent device wedge.

If the device wedges during AER recovery, the wedge is not seen as the first transition. The AER resume callback may then clear the flag and make the permanently wedged device appear usable again.

Keep the old device blocked while slot reset removes it, and block the new device until the AER resume callback.

The old AER path took a runtime PM reference to balance xe_device_wedged_fini(), which drops one when wedged.flag is set. AER no longer sets that flag, so keeping the Xe-owned reference would leak it. pcie_do_recovery() holds a PCI-core runtime PM reference across the error_detected, slot_reset and resume callbacks.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_bo.c            |  2 +-
 drivers/gpu/drm/xe/xe_device.c        |  4 ++--
 drivers/gpu/drm/xe/xe_device.h        | 12 ++++++++++++
 drivers/gpu/drm/xe/xe_guc_ct.c        |  4 ++--
 drivers/gpu/drm/xe/xe_guc_pc.c        | 10 +++++-----
 drivers/gpu/drm/xe/xe_guc_rc.c        |  4 ++--
 drivers/gpu/drm/xe/xe_guc_submit.c    |  8 ++++++--
 drivers/gpu/drm/xe/xe_guc_tlb_inval.c |  8 +++++++-
 drivers/gpu/drm/xe/xe_pci_error.c     | 22 +++++++++++-----------
 drivers/gpu/drm/xe/xe_sriov_pf.c      |  2 +-
 10 files changed, 49 insertions(+), 27 deletions(-)
drivers/gpu/drm/xe/xe_bo.c +1 -1
index dde309821237..b86cd6030ed6 100644
@@ -2094,7 +2094,7 @@ static vm_fault_t xe_bo_cpu_fault(struct vm_fault *vmf)
 	int err = 0;
 	int idx;
 
-	if (xe_device_wedged(xe) || !drm_dev_enter(&xe->drm, &idx))
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx))
 		return ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
 
 	ret = xe_bo_cpu_fault_fastpath(vmf, xe, bo, needs_rpm);
drivers/gpu/drm/xe/xe_device.c +2 -2
index 74d566693dfd..a92e90acdf0d 100644
@@ -225,7 +225,7 @@ static long xe_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
 	long ret;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return -ECANCELED;
 
 	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
@@ -243,7 +243,7 @@ static long xe_drm_compat_ioctl(struct file *file, unsigned int cmd, unsigned lo
 	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
 	long ret;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return -ECANCELED;
 
 	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
drivers/gpu/drm/xe/xe_device.h +12 -0
index 6c4cfaebc44a..a3f876c60d76 100644
@@ -212,6 +212,18 @@ static inline bool xe_device_wedged(struct xe_device *xe)
 	return atomic_read(&xe->wedged.flag);
 }
 
+/*
+ * Return true when device access must be blocked either permanently because
+ * the device is wedged or temporarily while PCI error recovery is running.
+ *
+ * Do not use this helper for one-way wedged-device decisions such as DMA
+ * isolation, IRQ resume suppression or recovery-method reporting.
+ */
+static inline bool xe_device_io_blocked(struct xe_device *xe)
+{
+	return xe_device_wedged(xe) || xe_device_is_in_reset(xe);
+}
+
 #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
 static inline bool xe_debug_page_size_supported(struct xe_device *xe)
 {
drivers/gpu/drm/xe/xe_guc_ct.c +2 -2
index 5c4733da385c..3c3fe4928fa2 100644
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action,
 	xe_gt_assert(gt, g2h_len || !num_g2h);
 	lockdep_assert_held(&ct->lock);
 
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {
 		ret = -ENOTRECOVERABLE;
 		goto out;
 	}
@@ -1813,7 +1813,7 @@ static int g2h_read(struct xe_guc_ct *ct, u32 *msg, bool fast_path)
 	xe_gt_assert(gt, xe_guc_ct_initialized(ct));
 	lockdep_assert_held(&ct->fast_lock);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return -ENOTRECOVERABLE;
 
 	if (ct->state == XE_GUC_CT_STATE_DISABLED)
drivers/gpu/drm/xe/xe_guc_pc.c +5 -5
index 097b075bd89a..9fe397296dc4 100644
@@ -188,7 +188,7 @@ static int pc_action_reset(struct xe_guc_pc *pc)
 	int ret;
 
 	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC reset failed: %pe\n",
 			  ERR_PTR(ret));
 
@@ -212,7 +212,7 @@ static int pc_action_query_task_state(struct xe_guc_pc *pc)
 
 	/* Blocking here to ensure the results are ready before reading them */
 	ret = xe_guc_ct_send_block(ct, action, ARRAY_SIZE(action));
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC query task state failed: %pe\n",
 			  ERR_PTR(ret));
 
@@ -235,7 +235,7 @@ static int pc_action_set_param(struct xe_guc_pc *pc, u8 id, u32 value)
 		return -EAGAIN;
 
 	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC set param[%u]=%u failed: %pe\n",
 			  id, value, ERR_PTR(ret));
 
@@ -257,7 +257,7 @@ static int pc_action_unset_param(struct xe_guc_pc *pc, u8 id)
 		return -EAGAIN;
 
 	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC unset param failed: %pe",
 			  ERR_PTR(ret));
 
@@ -1357,7 +1357,7 @@ static void xe_guc_pc_fini_hw(void *arg)
 	struct xe_guc_pc *pc = arg;
 	struct xe_device *xe = pc_to_xe(pc);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return;
 
 	xe_guc_pc_stop(pc);
drivers/gpu/drm/xe/xe_guc_rc.c +2 -2
index 99fa127b261f..eb5ec443f7ee 100644
@@ -40,7 +40,7 @@ static int guc_action_setup_gucrc(struct xe_guc *guc, u32 control)
 	int ret;
 
 	ret = xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(guc_to_xe(guc)) && ret == -ECANCELED))
+	if (ret && !(xe_device_io_blocked(guc_to_xe(guc)) && ret == -ECANCELED))
 		xe_gt_err(guc_to_gt(guc),
 			  "GuC RC setup %s(%u) failed (%pe)\n",
 			   control == GUCRC_HOST_CONTROL ? "HOST_CONTROL" :
@@ -73,7 +73,7 @@ static void xe_guc_rc_fini_hw(void *arg)
 	struct xe_device *xe = guc_to_xe(guc);
 	struct xe_gt *gt = guc_to_gt(guc);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return;
 
 	CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
drivers/gpu/drm/xe/xe_guc_submit.c +6 -2
index 99d8c807ff05..a307af458cf8 100644
@@ -2452,7 +2452,7 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
 						       WAIT_COND, HZ * 5);
 	}
 
-	if (!blocking && vf_recovery(guc) && !xe_device_wedged(xe))
+	if (!blocking && vf_recovery(guc) && !xe_device_io_blocked(xe))
 		return -EAGAIN;
 
 	if (!ret)
@@ -2694,7 +2694,11 @@ int xe_guc_submit_reset_prepare(struct xe_guc *guc)
 
 void xe_guc_submit_reset_wait(struct xe_guc *guc)
 {
-	wait_event(guc->ct.wq, xe_device_wedged(guc_to_xe(guc)) ||
+	/*
+	 * AER sets in_reset before declaring the GT wedged, which wakes this
+	 * waitqueue.
+	 */
+	wait_event(guc->ct.wq, xe_device_io_blocked(guc_to_xe(guc)) ||
 		   !xe_guc_read_stopped(guc));
 }
 
drivers/gpu/drm/xe/xe_guc_tlb_inval.c +7 -1
index 046d0655122f..646e13671cd9 100644
@@ -34,6 +34,9 @@ static int send_tlb_inval(struct xe_guc *guc, const u32 *action, int len)
 
 	xe_gt_assert(gt, action[1]);	/* Seqno */
 
+	if (xe_device_io_blocked(guc_to_xe(guc)))
+		return -ECANCELED;
+
 	xe_gt_stats_incr(gt, XE_GT_STATS_ID_TLB_INVAL, 1);
 	return xe_guc_ct_send(&guc->ct, action, len,
 			      G2H_LEN_DW_TLB_INVALIDATE, 1);
@@ -69,6 +72,9 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval *tlb_inval, u32 seqno)
 	 * signals waiters.
 	 */
 
+	if (xe_device_io_blocked(xe))
+		return -ECANCELED;
+
 	if (xe_guc_ct_enabled(&guc->ct) && guc->submission_state.enabled) {
 		u32 action[] = {
 			XE_GUC_ACTION_TLB_INVALIDATION,
@@ -77,7 +83,7 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval *tlb_inval, u32 seqno)
 		};
 
 		return send_tlb_inval(guc, action, ARRAY_SIZE(action));
-	} else if (xe_device_uc_enabled(xe) && !xe_device_wedged(xe)) {
+	} else if (xe_device_uc_enabled(xe)) {
 		struct xe_mmio *mmio = &gt->mmio;
 
 		if (IS_SRIOV_VF(xe))
drivers/gpu/drm/xe/xe_pci_error.c +11 -11
index 79ce0c671549..d82256d8721f 100644
@@ -9,7 +9,6 @@
 #include "xe_gt.h"
 #include "xe_log.h"
 #include "xe_pci.h"
-#include "xe_pm.h"
 #include "xe_printk.h"
 #include "xe_ras.h"
 #include "xe_survivability_mode.h"
@@ -20,14 +19,15 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
 	struct xe_gt *gt;
 	u8 id;
 
+
 	/*
-	 * Wedge the device to prevent userspace access but do not send the uevent.
-	 * xe_device_wedged_fini() releases runtime pm if wedged flag is set, so acquire a runtime
-	 * pm reference to avoid underflow.
+	 * Block device access while PCI error recovery is in progress.
+	 *
+	 * The old runtime PM reference balanced xe_device_wedged_fini() while
+	 * AER set wedged.flag. AER no longer sets that flag, and
+	 * pcie_do_recovery() holds its own runtime PM reference across the
+	 * recovery callbacks.
 	 */
-	if (!atomic_xchg(&xe->wedged.flag, 1))
-		xe_pm_runtime_get_noresume(xe);
-
 	xe_device_set_in_reset(xe);
 
 	for_each_gt(gt, xe, id)
@@ -116,7 +116,6 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
 	 * TODO: optimize by re-initializing only the hardware state and re-creating
 	 * kernel BOs.
 	 */
-	xe_device_clear_in_reset(xe);
 	pdev->driver->remove(pdev);
 	devres_release_group(&pdev->dev, xe->devres_group);
 
@@ -125,8 +124,8 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
 
 	xe = pdev_to_xe_device(pdev);
 
-	/* Wedge the device to prevent I/O operations till the resume callback */
-	atomic_set(&xe->wedged.flag, 1);
+	/* Block the new instance until the resume callback. */
+	xe_device_set_in_reset(xe);
 
 	return PCI_ERS_RESULT_RECOVERED;
 }
@@ -137,7 +136,8 @@ static void xe_pci_error_resume(struct pci_dev *pdev)
 
 	xe_info(xe, "PCI error: resume\n");
 
-	atomic_set(&xe->wedged.flag, 0);
+	/* Resume I/O operations. */
+	xe_device_clear_in_reset(xe);
 }
 
 const struct pci_error_handlers xe_pci_error_handlers = {
drivers/gpu/drm/xe/xe_sriov_pf.c +1 -1
index 33bd754d138f..568b7ed7c380 100644
@@ -157,7 +157,7 @@ int xe_sriov_pf_wait_ready(struct xe_device *xe)
 	unsigned int id;
 	int err;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
 		return -ECANCELED;
 
 	for_each_gt(gt, xe, id) {
Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH 02/13] drm/xe: Separate AER reset state from device wedging

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Medium] guc_ct_send_recv() still checks xe_device_wedged() instead of xe_device_io_blocked() when returning cancellation errors, causing state inconsistency.

Pre-existing issues:
- [High] Directly calling probe during AER slot reset bypasses driver core error handling, leading to double-remove and crashes if it fails. --

commit 1cbbd9c3fc1b9bad858f6195cfff20e523edc2ca
Author: Arvind Yadav <[email protected]>

drm/xe: Separate AER reset state from device wedging

This commit modifies the PCI error recovery path (AER) to use a temporary in_reset state instead of the permanent wedged flag to block driver I/O. It introduces the xe_device_io_blocked() helper to check both conditions, replacing xe_device_wedged() in multiple places where temporary blocks should also apply.

drivers/gpu/drm/xe/xe_guc_ct.c static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, · line 1068

Quoted 13 lines
drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
index 5c4733da385c5..3c3fe4928fa20 100644
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action,
 	xe_gt_assert(gt, g2h_len || !num_g2h);
 	lockdep_assert_held(&ct->lock);
 
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {
 		ret = -ENOTRECOVERABLE;
 		goto out;
 	}

[ ... ]

[Severity: Medium]
In guc_ct_send_recv(), the code still checks the old xe_device_wedged() state when returning cancellation errors:

	if (g2h_fence.fail) {
		if (g2h_fence.cancel) {
			xe_gt_dbg(gt, "H2G request %#x canceled!\n", action[0]);
			ret = xe_device_wedged(ct_to_xe(ct)) ? -ENOTRECOVERABLE : -ECANCELED;
			goto unlock;
		}

Does this leave a state inconsistency during a PCI AER reset? If an in-flight H2G request is cancelled because of a temporary IO block, xe_device_wedged() will evaluate to false. This means the caller receives -ECANCELED instead of -ENOTRECOVERABLE. Should this check be updated to use xe_device_io_blocked() as well?

[ ... ]

Quoted 4 lines
drivers/gpu/drm/xe/xe_pci_error.c +0 -0
index 79ce0c671549a..d82256d8721f3 100644

[ ... ]

drivers/gpu/drm/xe/xe_pci_error.c static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev) · line 121

Quoted 8 lines
drivers/gpu/drm/xe/xe_pci_error.c +0 -1
@@ -116,7 +116,6 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
 	 * TODO: optimize by re-initializing only the hardware state and re-creating
 	 * kernel BOs.
 	 */
-	xe_device_clear_in_reset(xe);
 	pdev->driver->remove(pdev);
 	devres_release_group(&pdev->dev, xe->devres_group);
 

[Severity: High]
This is a pre-existing issue, but does manually calling probe here bypass driver core error handling?

If pdev->driver->probe(pdev, ent) fails during xe_pci_error_slot_reset(), it returns PCI_ERS_RESULT_DISCONNECT. The PCI AER core will then unbind the driver and call pdev->driver->remove(pdev).

Since the failing probe likely already called xe_device_remove(xe) on its error path, wouldn't this lead to a double remove and potential crashes?

Quoted 11 lines
drivers/gpu/drm/xe/xe_pci_error.c +2 -2
@@ -125,8 +124,8 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
 
 	xe = pdev_to_xe_device(pdev);
 
-	/* Wedge the device to prevent I/O operations till the resume callback */
-	atomic_set(&xe->wedged.flag, 1);
+	/* Block the new instance until the resume callback. */
+	xe_device_set_in_reset(xe);
 
 	return PCI_ERS_RESULT_RECOVERED;
 }
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#8 lore raw

Re: [PATCH 02/13] drm/xe: Separate AER reset state from device wedging

In reply to Arvind Yadav

Hi Arvind,

drivers/gpu/drm/xe/xe_guc_ct.c static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, · line 1068

Quoted 9 lines
drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action,
 	xe_gt_assert(gt, g2h_len || !num_g2h);
 	lockdep_assert_held(&ct->lock);
 
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {
 		ret = -ENOTRECOVERABLE;
 		goto out;
 	}

There is another place in this function where xe_device_wedged is used.

...

drivers/gpu/drm/xe/xe_pci_error.c static void prepare_device_for_reset(struct pci_dev *pdev) · line 22

Quoted 5 lines
drivers/gpu/drm/xe/xe_pci_error.c +1 -0
@@ -20,14 +19,15 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
 	struct xe_gt *gt;
 	u8 id;
 
+

Please remove this blank line.

Thanks,
Andi

Quoted 7 lines
drivers/gpu/drm/xe/xe_pci_error.c +3 -3
 	/*
-	 * Wedge the device to prevent userspace access but do not send the uevent.
-	 * xe_device_wedged_fini() releases runtime pm if wedged flag is set, so acquire a runtime
-	 * pm reference to avoid underflow.
+	 * Block device access while PCI error recovery is in progress.
+	 *
+	 * The old runtime PM reference balanced xe_device_wedged_fini() while
#9 lore raw

Re: [PATCH 02/13] drm/xe: Separate AER reset state from device wedging

Quoted 6 lines · Andi Shyti

Hi Arvind,

Quoted 4 lines
drivers/gpu/drm/xe/xe_guc_ct.c +0 -0
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action,
  	xe_gt_assert(gt, g2h_len || !num_g2h);
  	lockdep_assert_held(&ct->lock);
 
Quoted 7 lines

drivers/gpu/drm/xe/xe_guc_ct.c static int __guc_ct_send_locked(struct xe_guc_ct *ct, const u32 *action, · line 1068

Quoted 5 lines
drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {
  		ret = -ENOTRECOVERABLE;
  		goto out;
  	}

There is another place in this function where xe_device_wedged is used.

Thanks for the review.
The later xe_device_wedged() check is intentional, as it determines the error returned to the caller. A permanent device wedge should return -ENOTRECOVERABLE, whereas a request canceled during AER recovery should return -ECANCELED.

For that reason, this check should remain as xe_device_wedged().

Quoted 9 lines

...

drivers/gpu/drm/xe/xe_pci_error.c static void prepare_device_for_reset(struct pci_dev *pdev) · line 22

Quoted 5 lines
drivers/gpu/drm/xe/xe_pci_error.c +1 -0
@@ -20,14 +19,15 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
  	struct xe_gt *gt;
  	u8 id;
 
+

Please remove this blank line.

Noted.

Thankyou,
Arvind

Quoted 11 lines

Thanks,
Andi

Quoted 7 lines
drivers/gpu/drm/xe/xe_pci_error.c +3 -3
  	/*
-	 * Wedge the device to prevent userspace access but do not send the uevent.
-	 * xe_device_wedged_fini() releases runtime pm if wedged flag is set, so acquire a runtime
-	 * pm reference to avoid underflow.
+	 * Block device access while PCI error recovery is in progress.
+	 *
+	 * The old runtime PM reference balanced xe_device_wedged_fini() while
#10 lore raw

Re: [PATCH 2/13] drm/xe: Separate AER reset state from device wedging

In reply to Arvind Yadav
Cc Riana
Quoted 15 lines · Arvind Yadav

PCI error recovery currently uses xe->wedged.flag to block driver access. This mixes a temporary AER reset with a permanent device wedge.

If the device wedges during AER recovery, the wedge is not seen as the first transition. The AER resume callback may then clear the flag and make the permanently wedged device appear usable again.

Keep the old device blocked while slot reset removes it, and block the new device until the AER resume callback.

The old AER path took a runtime PM reference to balance xe_device_wedged_fini(), which drops one when wedged.flag is set. AER no longer sets that flag, so keeping the Xe-owned reference would leak it. pcie_do_recovery() holds a PCI-core runtime PM reference across the error_detected, slot_reset and resume callbacks.

...

drivers/gpu/drm/xe/xe_device.h static inline bool xe_device_wedged(struct xe_device *xe) · line 225

Quoted 11 lines
drivers/gpu/drm/xe/xe_device.h +11 -0
+/*
+ * Return true when device access must be blocked either permanently because
+ * the device is wedged or temporarily while PCI error recovery is running.
+ *
+ * Do not use this helper for one-way wedged-device decisions such as DMA
+ * isolation, IRQ resume suppression or recovery-method reporting.
+ */
+static inline bool xe_device_io_blocked(struct xe_device *xe)
+{
+	return xe_device_wedged(xe) || xe_device_is_in_reset(xe);
+}

This is already documented below but still FYI:

The long term plan to reuse FLR flow[1] in AER path and move over from 'reset' states to temporary wedging.

Raag

[1] https://patchwork.freedesktop.org/series/162055/

Quoted 7 lines
drivers/gpu/drm/xe/xe_pci_error.c +0 -1
@@ -116,7 +116,6 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
 	 * TODO: optimize by re-initializing only the hardware state and re-creating
 	 * kernel BOs.
 	 */
-	xe_device_clear_in_reset(xe);
 	pdev->driver->remove(pdev);
 	devres_release_group(&pdev->dev, xe->devres_group);
#11 lore raw

Re: [PATCH 02/13] drm/xe: Separate AER reset state from device wedging

In reply to Arvind Yadav
Quoted 335 lines · Arvind Yadav

PCI error recovery currently uses xe->wedged.flag to block driver access. This mixes a temporary AER reset with a permanent device wedge.

If the device wedges during AER recovery, the wedge is not seen as the
first transition. The AER resume callback may then clear the flag and make the permanently wedged device appear usable again.

Keep the old device blocked while slot reset removes it, and block the
new device until the AER resume callback.

The old AER path took a runtime PM reference to balance xe_device_wedged_fini(), which drops one when wedged.flag is set. AER no
longer sets that flag, so keeping the Xe-owned reference would leak it.
pcie_do_recovery() holds a PCI-core runtime PM reference across the error_detected, slot_reset and resume callbacks.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8

---
 drivers/gpu/drm/xe/xe_bo.c            |  2 +-

 drivers/gpu/drm/xe/xe_device.c        |  4 ++--
 drivers/gpu/drm/xe/xe_device.h        | 12 ++++++++++++
 drivers/gpu/drm/xe/xe_guc_ct.c        |  4 ++--
 drivers/gpu/drm/xe/xe_guc_pc.c        | 10 +++++-----
 drivers/gpu/drm/xe/xe_guc_rc.c        |  4 ++--

 drivers/gpu/drm/xe/xe_guc_submit.c    |  8 ++++++-- drivers/gpu/drm/xe/xe_guc_tlb_inval.c |  8 +++++++- drivers/gpu/drm/xe/xe_pci_error.c     | 22 +++++++++++----------- drivers/gpu/drm/xe/xe_sriov_pf.c      |  2 +-

 10 files changed, 49 insertions(+), 27 deletions(-)
drivers/gpu/drm/xe/xe_bo.c +0 -0
index dde309821237..b86cd6030ed6 100644
@@ -2094,7 +2094,7 @@ static vm_fault_t xe_bo_cpu_fault(struct
 vm_fault *vmf)
  	int err = 0;
  	int idx;

drivers/gpu/drm/xe/xe_bo.c +1 -1
-	if (xe_device_wedged(xe) || !drm_dev_enter(&xe->drm, &idx))
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm,

&idx))
  return ttm_bo_vm_dummy_page(vmf, vmf->vma-

Quoted 1 line

vm_page_prot);


  ret = xe_bo_cpu_fault_fastpath(vmf, xe, bo, needs_rpm);

drivers/gpu/drm/xe/xe_device.c +0 -0
index 74d566693dfd..a92e90acdf0d 100644
@@ -225,7 +225,7 @@ static long xe_drm_ioctl(struct file *file,
 unsigned int cmd, unsigned long arg)
  	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
  	long ret;

drivers/gpu/drm/xe/xe_device.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))

  return -ECANCELED;

  ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);

drivers/gpu/drm/xe/xe_device.c +0 -0
@@ -243,7 +243,7 @@ static long xe_drm_compat_ioctl(struct file
 *file, unsigned int cmd, unsigned lo
  	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
  	long ret;

drivers/gpu/drm/xe/xe_device.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))

  return -ECANCELED;

  ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);

drivers/gpu/drm/xe/xe_device.h +0 -0
index 6c4cfaebc44a..a3f876c60d76 100644
@@ -212,6 +212,18 @@ static inline bool xe_device_wedged(struct
 xe_device *xe)
  	return atomic_read(&xe->wedged.flag);
  }


+/*
+ * Return true when device access must be blocked either permanently because
+ * the device is wedged or temporarily while PCI error recovery is running.
+ *
+ * Do not use this helper for one-way wedged-device decisions such as DMA
+ * isolation, IRQ resume suppression or recovery-method reporting.
+ */

drivers/gpu/drm/xe/xe_device.h +5 -0
+static inline bool xe_device_io_blocked(struct xe_device *xe)
+{
+	return xe_device_wedged(xe) || xe_device_is_in_reset(xe);
+}
+

 #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
 static inline bool xe_debug_page_size_supported(struct xe_device *xe)
 {

drivers/gpu/drm/xe/xe_guc_ct.c +0 -0
index 5c4733da385c..3c3fe4928fa2 100644
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct
 xe_guc_ct *ct, const u32 *action,
  	xe_gt_assert(gt, g2h_len || !num_g2h);
  	lockdep_assert_held(&ct->lock);

drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {

  ret = -ENOTRECOVERABLE;
  goto out;
  }

drivers/gpu/drm/xe/xe_guc_ct.c +0 -0
@@ -1813,7 +1813,7 @@ static int g2h_read(struct xe_guc_ct *ct, u32
 *msg, bool fast_path)
  	xe_gt_assert(gt, xe_guc_ct_initialized(ct));
  	lockdep_assert_held(&ct->fast_lock);

drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))

  return -ENOTRECOVERABLE;

  if (ct->state == XE_GUC_CT_STATE_DISABLED)

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
index 097b075bd89a..9fe397296dc4 100644
@@ -188,7 +188,7 @@ static int pc_action_reset(struct xe_guc_pc *pc)
  	int ret;


  ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);

drivers/gpu/drm/xe/xe_guc_pc.c +0 -1
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -

ECANCELED))
  xe_gt_err(pc_to_gt(pc), "GuC PC reset failed:
%pe\n",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
@@ -212,7 +212,7 @@ static int pc_action_query_task_state(struct
 xe_guc_pc *pc)


  /* Blocking here to ensure the results are ready before reading them */
  ret = xe_guc_ct_send_block(ct, action, ARRAY_SIZE(action));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -1
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -

ECANCELED))
  xe_gt_err(pc_to_gt(pc), "GuC PC query task state
failed: %pe\n",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
@@ -235,7 +235,7 @@ static int pc_action_set_param(struct xe_guc_pc
 *pc, u8 id, u32 value)
  		return -EAGAIN;


  ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);

drivers/gpu/drm/xe/xe_guc_pc.c +0 -1
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -

ECANCELED))
  xe_gt_err(pc_to_gt(pc), "GuC PC set param[%u]=%u
failed: %pe\n",
    id, value, ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
@@ -257,7 +257,7 @@ static int pc_action_unset_param(struct xe_guc_pc
 *pc, u8 id)
  		return -EAGAIN;


  ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);

drivers/gpu/drm/xe/xe_guc_pc.c +0 -1
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -

ECANCELED))
  xe_gt_err(pc_to_gt(pc), "GuC PC unset param failed:
%pe",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
@@ -1357,7 +1357,7 @@ static void xe_guc_pc_fini_hw(void *arg)
  	struct xe_guc_pc *pc = arg;
  	struct xe_device *xe = pc_to_xe(pc);

drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))

  return;

  xe_guc_pc_stop(pc);

drivers/gpu/drm/xe/xe_guc_rc.c +0 -0
index 99fa127b261f..eb5ec443f7ee 100644
@@ -40,7 +40,7 @@ static int guc_action_setup_gucrc(struct xe_guc
 *guc, u32 control)
  	int ret;


  ret = xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action), 0, 0);

drivers/gpu/drm/xe/xe_guc_rc.c +0 -1
-	if (ret && !(xe_device_wedged(guc_to_xe(guc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_rc.c +1 -1
+	if (ret && !(xe_device_io_blocked(guc_to_xe(guc)) && ret ==
-ECANCELED))

  xe_gt_err(guc_to_gt(guc),
    "GuC RC setup %s(%u) failed (%pe)\n", control == GUCRC_HOST_CONTROL ? "HOST_CONTROL" :

drivers/gpu/drm/xe/xe_guc_rc.c +0 -0
@@ -73,7 +73,7 @@ static void xe_guc_rc_fini_hw(void *arg)
  	struct xe_device *xe = guc_to_xe(guc);
  	struct xe_gt *gt = guc_to_gt(guc);

drivers/gpu/drm/xe/xe_guc_rc.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))

  return;

  CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);

drivers/gpu/drm/xe/xe_guc_submit.c +0 -0
index 99d8c807ff05..a307af458cf8 100644
@@ -2452,7 +2452,7 @@ static int

guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki WAIT_COND, HZ
* 5);
  }

drivers/gpu/drm/xe/xe_guc_submit.c +1 -1
-	if (!blocking && vf_recovery(guc) && !xe_device_wedged(xe))
+	if (!blocking && vf_recovery(guc) &&

!xe_device_io_blocked(xe))
  return -EAGAIN;

  if (!ret)

drivers/gpu/drm/xe/xe_guc_submit.c +0 -0
@@ -2694,7 +2694,11 @@ int xe_guc_submit_reset_prepare(struct xe_guc
 *guc)


 void xe_guc_submit_reset_wait(struct xe_guc *guc) {

drivers/gpu/drm/xe/xe_guc_submit.c +2 -1
-	wait_event(guc->ct.wq, xe_device_wedged(guc_to_xe(guc)) ||
+	/*
+	 * AER sets in_reset before declaring the GT wedged, which

wakes this

drivers/gpu/drm/xe/xe_guc_submit.c +3 -0
+	 * waitqueue.
+	 */
+	wait_event(guc->ct.wq, xe_device_io_blocked(guc_to_xe(guc))

||
     !xe_guc_read_stopped(guc));
 }

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +0 -0
index 046d0655122f..646e13671cd9 100644
@@ -34,6 +34,9 @@ static int send_tlb_inval(struct xe_guc *guc, const
 u32 *action, int len)


  xe_gt_assert(gt, action[1]); /* Seqno */

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +3 -0
+	if (xe_device_io_blocked(guc_to_xe(guc)))
+		return -ECANCELED;
+

  xe_gt_stats_incr(gt, XE_GT_STATS_ID_TLB_INVAL, 1); return xe_guc_ct_send(&guc->ct, action, len, G2H_LEN_DW_TLB_INVALIDATE, 1);

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +0 -0
@@ -69,6 +72,9 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval
 *tlb_inval, u32 seqno)
  	 * signals waiters.
  	 */

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +3 -0
+	if (xe_device_io_blocked(xe))
+		return -ECANCELED;
+

  if (xe_guc_ct_enabled(&guc->ct) && guc-

Quoted 1 line

submission_state.enabled) {

  u32 action[] = { XE_GUC_ACTION_TLB_INVALIDATION,

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +0 -0
@@ -77,7 +83,7 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval
 *tlb_inval, u32 seqno)
  		};


  return send_tlb_inval(guc, action, ARRAY_SIZE(action));

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +0 -1
-	} else if (xe_device_uc_enabled(xe) &&

!xe_device_wedged(xe)) {

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +1 -0
+	} else if (xe_device_uc_enabled(xe)) {

  struct xe_mmio *mmio = &gt->mmio;

  if (IS_SRIOV_VF(xe))

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
index 79ce0c671549..d82256d8721f 100644
@@ -9,7 +9,6 @@
  #include "xe_gt.h"
  #include "xe_log.h"
  #include "xe_pci.h"
-#include "xe_pm.h"
  #include "xe_printk.h"
  #include "xe_ras.h"
  #include "xe_survivability_mode.h"
@@ -20,14 +19,15 @@ static void prepare_device_for_reset(struct
 pci_dev *pdev)
  	struct xe_gt *gt;
  	u8 id;


+
  /*

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
-	 * Wedge the device to prevent userspace access but do not

send the uevent.

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
-	 * xe_device_wedged_fini() releases runtime pm if wedged

flag is set, so acquire a runtime

drivers/gpu/drm/xe/xe_pci_error.c +1 -1
-	 * pm reference to avoid underflow.
+	 * Block device access while PCI error recovery is in

progress.

drivers/gpu/drm/xe/xe_pci_error.c +2 -0
+	 *
+	 * The old runtime PM reference balanced

xe_device_wedged_fini() while

drivers/gpu/drm/xe/xe_pci_error.c +2 -0
+	 * AER set wedged.flag. AER no longer sets that flag, and
+	 * pcie_do_recovery() holds its own runtime PM reference

across the

drivers/gpu/drm/xe/xe_pci_error.c static void prepare_device_for_reset(struct pci_dev *pdev) · line 29

Quoted 1 line
drivers/gpu/drm/xe/xe_pci_error.c +1 -0
+	 * recovery callbacks.

This is an in-code comment describing what this patch is doing. A future code reader has no idea what "The old runtime PM reference" is. Please keep comments involving the old pre-patch code in the commit message.

Quoted 52 lines

  */

drivers/gpu/drm/xe/xe_pci_error.c +0 -3
-	if (!atomic_xchg(&xe->wedged.flag, 1))
-		xe_pm_runtime_get_noresume(xe);
-

  xe_device_set_in_reset(xe);

  for_each_gt(gt, xe, id)

drivers/gpu/drm/xe/xe_pci_error.c +0 -0
@@ -116,7 +116,6 @@ static pci_ers_result_t
 xe_pci_error_slot_reset(struct pci_dev *pdev)
  	 * TODO: optimize by re-initializing only the hardware state

and re-creating
  * kernel BOs.
  */

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
-	xe_device_clear_in_reset(xe);

  pdev->driver->remove(pdev); devres_release_group(&pdev->dev, xe->devres_group);

drivers/gpu/drm/xe/xe_pci_error.c +0 -0
@@ -125,8 +124,8 @@ static pci_ers_result_t
 xe_pci_error_slot_reset(struct pci_dev *pdev)


  xe = pdev_to_xe_device(pdev);

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
-	/* Wedge the device to prevent I/O operations till the

resume callback */

drivers/gpu/drm/xe/xe_pci_error.c +2 -1
-	atomic_set(&xe->wedged.flag, 1);
+	/* Block the new instance until the resume callback. */
+	xe_device_set_in_reset(xe);


  return PCI_ERS_RESULT_RECOVERED;
 }

drivers/gpu/drm/xe/xe_pci_error.c +0 -0
@@ -137,7 +136,8 @@ static void xe_pci_error_resume(struct pci_dev
 *pdev)


  xe_info(xe, "PCI error: resume\n");

drivers/gpu/drm/xe/xe_pci_error.c +2 -1
-	atomic_set(&xe->wedged.flag, 0);
+	/* Resume I/O operations. */
+	xe_device_clear_in_reset(xe);

 }

 const struct pci_error_handlers xe_pci_error_handlers = {

drivers/gpu/drm/xe/xe_sriov_pf.c +0 -0
index 33bd754d138f..568b7ed7c380 100644
@@ -157,7 +157,7 @@ int xe_sriov_pf_wait_ready(struct xe_device *xe)
  	unsigned int id;
  	int err;

drivers/gpu/drm/xe/xe_sriov_pf.c +1 -1
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
Quoted 3 lines

  return -ECANCELED;

  for_each_gt(gt, xe, id) {

/Thomas

#12 lore raw

Re: [PATCH 02/13] drm/xe: Separate AER reset state from device wedging

Quoted 333 lines · Thomas Hellström
Quoted 332 lines · Arvind Yadav

PCI error recovery currently uses xe->wedged.flag to block driver access. This mixes a temporary AER reset with a permanent device wedge.

If the device wedges during AER recovery, the wedge is not seen as the
first transition. The AER resume callback may then clear the flag and make the permanently wedged device appear usable again.

Keep the old device blocked while slot reset removes it, and block the
new device until the AER resume callback.

The old AER path took a runtime PM reference to balance xe_device_wedged_fini(), which drops one when wedged.flag is set. AER no
longer sets that flag, so keeping the Xe-owned reference would leak it.
pcie_do_recovery() holds a PCI-core runtime PM reference across the error_detected, slot_reset and resume callbacks.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_bo.c            |  2 +-
  drivers/gpu/drm/xe/xe_device.c        |  4 ++--
  drivers/gpu/drm/xe/xe_device.h        | 12 ++++++++++++
  drivers/gpu/drm/xe/xe_guc_ct.c        |  4 ++--
  drivers/gpu/drm/xe/xe_guc_pc.c        | 10 +++++-----
  drivers/gpu/drm/xe/xe_guc_rc.c        |  4 ++--
  drivers/gpu/drm/xe/xe_guc_submit.c    |  8 ++++++--
  drivers/gpu/drm/xe/xe_guc_tlb_inval.c |  8 +++++++-
  drivers/gpu/drm/xe/xe_pci_error.c     | 22 +++++++++++-----------
  drivers/gpu/drm/xe/xe_sriov_pf.c      |  2 +-
  10 files changed, 49 insertions(+), 27 deletions(-)
drivers/gpu/drm/xe/xe_bo.c +1 -1
index dde309821237..b86cd6030ed6 100644
@@ -2094,7 +2094,7 @@ static vm_fault_t xe_bo_cpu_fault(struct
 vm_fault *vmf)
  	int err = 0;
  	int idx;
 
-	if (xe_device_wedged(xe) || !drm_dev_enter(&xe->drm, &idx))
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm,
 &idx))
  		return ttm_bo_vm_dummy_page(vmf, vmf->vma-
Quoted 1 line

vm_page_prot);

  ret = xe_bo_cpu_fault_fastpath(vmf, xe, bo, needs_rpm);

drivers/gpu/drm/xe/xe_device.c +1 -1
index 74d566693dfd..a92e90acdf0d 100644
@@ -225,7 +225,7 @@ static long xe_drm_ioctl(struct file *file,
 unsigned int cmd, unsigned long arg)
  	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
  	long ret;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return -ECANCELED;
 

  ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);

drivers/gpu/drm/xe/xe_device.c +1 -1
@@ -243,7 +243,7 @@ static long xe_drm_compat_ioctl(struct file
 *file, unsigned int cmd, unsigned lo
  	struct xe_device *xe = to_xe_device(file_priv->minor->dev);
  	long ret;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return -ECANCELED;
 

  ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);

drivers/gpu/drm/xe/xe_device.h +2 -0
index 6c4cfaebc44a..a3f876c60d76 100644
@@ -212,6 +212,18 @@ static inline bool xe_device_wedged(struct
 xe_device *xe)
  	return atomic_read(&xe->wedged.flag);
  }
 
+/*
+ * Return true when device access must be blocked either permanently

because
+ * the device is wedged or temporarily while PCI error recovery is running.
+ *
+ * Do not use this helper for one-way wedged-device decisions such as DMA
+ * isolation, IRQ resume suppression or recovery-method reporting.
+ */

drivers/gpu/drm/xe/xe_device.h +5 -0
+static inline bool xe_device_io_blocked(struct xe_device *xe)
+{
+	return xe_device_wedged(xe) || xe_device_is_in_reset(xe);
+}
+
  #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
  static inline bool xe_debug_page_size_supported(struct xe_device

*xe)
 {

drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
index 5c4733da385c..3c3fe4928fa2 100644
@@ -1062,7 +1062,7 @@ static int __guc_ct_send_locked(struct
 xe_guc_ct *ct, const u32 *action,
  	xe_gt_assert(gt, g2h_len || !num_g2h);
  	lockdep_assert_held(&ct->lock);
 
-	if (xe_device_wedged(ct_to_xe(ct))) {
+	if (xe_device_io_blocked(ct_to_xe(ct))) {
  		ret = -ENOTRECOVERABLE;
  		goto out;

  }

drivers/gpu/drm/xe/xe_guc_ct.c +1 -1
@@ -1813,7 +1813,7 @@ static int g2h_read(struct xe_guc_ct *ct, u32
 *msg, bool fast_path)
  	xe_gt_assert(gt, xe_guc_ct_initialized(ct));
  	lockdep_assert_held(&ct->fast_lock);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return -ENOTRECOVERABLE;
 

  if (ct->state == XE_GUC_CT_STATE_DISABLED)

drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
index 097b075bd89a..9fe397296dc4 100644
@@ -188,7 +188,7 @@ static int pc_action_reset(struct xe_guc_pc *pc)
  	int ret;
 
  	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -
 ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -
 ECANCELED))
  		xe_gt_err(pc_to_gt(pc), "GuC PC reset failed:

%pe\n",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -0
@@ -212,7 +212,7 @@ static int pc_action_query_task_state(struct
 xe_guc_pc *pc)
 
  	/* Blocking here to ensure the results are ready before

reading them */
  ret = xe_guc_ct_send_block(ct, action, ARRAY_SIZE(action));

drivers/gpu/drm/xe/xe_guc_pc.c +0 -1
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -

ECANCELED))

drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -

ECANCELED))
  xe_gt_err(pc_to_gt(pc), "GuC PC query task state
failed: %pe\n",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
@@ -235,7 +235,7 @@ static int pc_action_set_param(struct xe_guc_pc
 *pc, u8 id, u32 value)
  		return -EAGAIN;
 
  	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -
 ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -
 ECANCELED))

  xe_gt_err(pc_to_gt(pc), "GuC PC set param[%u]=%u
failed: %pe\n",
    id, value, ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
@@ -257,7 +257,7 @@ static int pc_action_unset_param(struct xe_guc_pc
 *pc, u8 id)
  		return -EAGAIN;
 
  	ret = xe_guc_ct_send(ct, action, ARRAY_SIZE(action), 0, 0);
-	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -
 ECANCELED))
+	if (ret && !(xe_device_io_blocked(pc_to_xe(pc)) && ret == -
 ECANCELED))

  xe_gt_err(pc_to_gt(pc), "GuC PC unset param failed:
%pe",
    ERR_PTR(ret));

drivers/gpu/drm/xe/xe_guc_pc.c +1 -1
@@ -1357,7 +1357,7 @@ static void xe_guc_pc_fini_hw(void *arg)
  	struct xe_guc_pc *pc = arg;
  	struct xe_device *xe = pc_to_xe(pc);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return;
 
  	xe_guc_pc_stop(pc);
drivers/gpu/drm/xe/xe_guc_rc.c +1 -2
index 99fa127b261f..eb5ec443f7ee 100644
@@ -40,7 +40,7 @@ static int guc_action_setup_gucrc(struct xe_guc
 *guc, u32 control)
  	int ret;
 
  	ret = xe_guc_ct_send(&guc->ct, action, ARRAY_SIZE(action),
 0, 0);
-	if (ret && !(xe_device_wedged(guc_to_xe(guc)) && ret == -
 ECANCELED))
+	if (ret && !(xe_device_io_blocked(guc_to_xe(guc)) && ret ==
-ECANCELED))
  		xe_gt_err(guc_to_gt(guc),
  			  "GuC RC setup %s(%u) failed (%pe)\n",
  			   control == GUCRC_HOST_CONTROL ?

"HOST_CONTROL" :

drivers/gpu/drm/xe/xe_guc_rc.c +1 -1
@@ -73,7 +73,7 @@ static void xe_guc_rc_fini_hw(void *arg)
  	struct xe_device *xe = guc_to_xe(guc);
  	struct xe_gt *gt = guc_to_gt(guc);
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return;
 
  	CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
drivers/gpu/drm/xe/xe_guc_submit.c +0 -0
index 99d8c807ff05..a307af458cf8 100644
@@ -2452,7 +2452,7 @@ static int

guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
         WAIT_COND, HZ
* 5);
  }

drivers/gpu/drm/xe/xe_guc_submit.c +1 -1
-	if (!blocking && vf_recovery(guc) && !xe_device_wedged(xe))
+	if (!blocking && vf_recovery(guc) &&

!xe_device_io_blocked(xe))
  return -EAGAIN;

  if (!ret)

drivers/gpu/drm/xe/xe_guc_submit.c +2 -1
@@ -2694,7 +2694,11 @@ int xe_guc_submit_reset_prepare(struct xe_guc
 *guc)
 
  void xe_guc_submit_reset_wait(struct xe_guc *guc)
  {
-	wait_event(guc->ct.wq, xe_device_wedged(guc_to_xe(guc)) ||
+	/*
+	 * AER sets in_reset before declaring the GT wedged, which

wakes this

drivers/gpu/drm/xe/xe_guc_submit.c +3 -0
+	 * waitqueue.
+	 */
+	wait_event(guc->ct.wq, xe_device_io_blocked(guc_to_xe(guc))

||
     !xe_guc_read_stopped(guc));
 }

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +3 -0
index 046d0655122f..646e13671cd9 100644
@@ -34,6 +34,9 @@ static int send_tlb_inval(struct xe_guc *guc, const
 u32 *action, int len)
 
  	xe_gt_assert(gt, action[1]);	/* Seqno */
 
+	if (xe_device_io_blocked(guc_to_xe(guc)))
+		return -ECANCELED;
+
  	xe_gt_stats_incr(gt, XE_GT_STATS_ID_TLB_INVAL, 1);
  	return xe_guc_ct_send(&guc->ct, action, len,

        G2H_LEN_DW_TLB_INVALIDATE, 1);

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +3 -0
@@ -69,6 +72,9 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval
 *tlb_inval, u32 seqno)
  	 * signals waiters.
  	 */
 
+	if (xe_device_io_blocked(xe))
+		return -ECANCELED;
+
  	if (xe_guc_ct_enabled(&guc->ct) && guc-
 > submission_state.enabled) {

  u32 action[] = { XE_GUC_ACTION_TLB_INVALIDATION,

drivers/gpu/drm/xe/xe_guc_tlb_inval.c +1 -1
@@ -77,7 +83,7 @@ static int send_tlb_inval_ggtt(struct xe_tlb_inval
 *tlb_inval, u32 seqno)
  		};
 
  		return send_tlb_inval(guc, action,
 ARRAY_SIZE(action));
-	} else if (xe_device_uc_enabled(xe) &&
 !xe_device_wedged(xe)) {
+	} else if (xe_device_uc_enabled(xe)) {

  struct xe_mmio *mmio = &gt->mmio;

  if (IS_SRIOV_VF(xe))

drivers/gpu/drm/xe/xe_pci_error.c +1 -2
index 79ce0c671549..d82256d8721f 100644
@@ -9,7 +9,6 @@
  #include "xe_gt.h"
  #include "xe_log.h"
  #include "xe_pci.h"
-#include "xe_pm.h"
  #include "xe_printk.h"
  #include "xe_ras.h"
  #include "xe_survivability_mode.h"
@@ -20,14 +19,15 @@ static void prepare_device_for_reset(struct
 pci_dev *pdev)
  	struct xe_gt *gt;
  	u8 id;
 
+
  	/*
-	 * Wedge the device to prevent userspace access but do not

send the uevent.

drivers/gpu/drm/xe/xe_pci_error.c +0 -1
-	 * xe_device_wedged_fini() releases runtime pm if wedged

flag is set, so acquire a runtime

drivers/gpu/drm/xe/xe_pci_error.c +1 -1
-	 * pm reference to avoid underflow.
+	 * Block device access while PCI error recovery is in

progress.

drivers/gpu/drm/xe/xe_pci_error.c +2 -0
+	 *
+	 * The old runtime PM reference balanced

xe_device_wedged_fini() while

Quoted 8 lines

drivers/gpu/drm/xe/xe_pci_error.c static void prepare_device_for_reset(struct pci_dev *pdev) · line 29

Quoted 4 lines
drivers/gpu/drm/xe/xe_pci_error.c +2 -0
+	 * AER set wedged.flag. AER no longer sets that flag, and
+	 * pcie_do_recovery() holds its own runtime PM reference

across the

drivers/gpu/drm/xe/xe_pci_error.c +1 -0
+	 * recovery callbacks.

This is an in-code comment describing what this patch is doing. A future code reader has no idea what "The old runtime PM reference" is. Please keep comments involving the old pre-patch code in the commit message.

Thanks for the review.

Agreed. I will keep the old runtime PM details in the commit message. and the comment will only describe the current behavior.

Thanks,
Arvind

Quoted 59 lines
Quoted 49 lines

  */

drivers/gpu/drm/xe/xe_pci_error.c +0 -3
-	if (!atomic_xchg(&xe->wedged.flag, 1))
-		xe_pm_runtime_get_noresume(xe);
-
  	xe_device_set_in_reset(xe);
 
  	for_each_gt(gt, xe, id)
@@ -116,7 +116,6 @@ static pci_ers_result_t
 xe_pci_error_slot_reset(struct pci_dev *pdev)
  	 * TODO: optimize by re-initializing only the hardware state

and re-creating
  * kernel BOs.
  */

drivers/gpu/drm/xe/xe_pci_error.c +0 -2
-	xe_device_clear_in_reset(xe);
  	pdev->driver->remove(pdev);
  	devres_release_group(&pdev->dev, xe->devres_group);
@@ -125,8 +124,8 @@ static pci_ers_result_t
 xe_pci_error_slot_reset(struct pci_dev *pdev)
 
  	xe = pdev_to_xe_device(pdev);
 
-	/* Wedge the device to prevent I/O operations till the

resume callback */

drivers/gpu/drm/xe/xe_pci_error.c +4 -2
-	atomic_set(&xe->wedged.flag, 1);
+	/* Block the new instance until the resume callback. */
+	xe_device_set_in_reset(xe);
 
  	return PCI_ERS_RESULT_RECOVERED;
  }
@@ -137,7 +136,8 @@ static void xe_pci_error_resume(struct pci_dev
 *pdev)
 
  	xe_info(xe, "PCI error: resume\n");
 
-	atomic_set(&xe->wedged.flag, 0);
+	/* Resume I/O operations. */
+	xe_device_clear_in_reset(xe);
  }
 

 const struct pci_error_handlers xe_pci_error_handlers = {

drivers/gpu/drm/xe/xe_sriov_pf.c +0 -0
index 33bd754d138f..568b7ed7c380 100644

drivers/gpu/drm/xe/xe_sriov_pf.c int xe_sriov_pf_wait_ready(struct xe_device *xe) · line 163

Quoted 8 lines
drivers/gpu/drm/xe/xe_sriov_pf.c +1 -1
@@ -157,7 +157,7 @@ int xe_sriov_pf_wait_ready(struct xe_device *xe)
  	unsigned int id;
  	int err;
 
-	if (xe_device_wedged(xe))
+	if (xe_device_io_blocked(xe))
  		return -ECANCELED;
 
  	for_each_gt(gt, xe, id) {

/Thomas

#13 lore raw

PATCH 3/13 drm/xe: Drop queued page faults when device I/O is blocked

In reply to Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +40 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
 	xe_vm_put(vm);
 }
 
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;
+	}
+
+	return true;
+}
+
 static void xe_pagefault_queue_work(struct work_struct *w)
 {
 	struct xe_pagefault_work *pf_work =
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
 		int err = 0;
 		bool invalidated = false;
 
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;
+
 		/* Last fault same address, ack immediately */
 		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
 			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
 
 		err = xe_pagefault_service(pf);
 
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;
+
 		if (err) {
 			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
 				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
maintainer
#14 lore raw

Re: [PATCH 03/13] drm/xe: Drop queued page faults when device I/O is blocked

Quoted 44 lines · Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +17 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
 	xe_vm_put(vm);
 }
 
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p · line 621

Quoted 10 lines
drivers/gpu/drm/xe/xe_pagefault.c +10 -0
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;

is there some helper we could re-use? I know we cannot use the pop directly, because it would deadlock, but perhaps we can unify some code here...

Quoted 9 lines
drivers/gpu/drm/xe/xe_pagefault.c +5 -0
+	}
+
+	return true;
+}
+
 static void xe_pagefault_queue_work(struct work_struct *w)
 {
 	struct xe_pagefault_work *pf_work =

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 652

Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
 		int err = 0;
 		bool invalidated = false;
 
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;

do we really need to loop inside the loop or only check and let this main loop goes?

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 663

Quoted 10 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
+
 		/* Last fault same address, ack immediately */
 		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
 			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
 
 		err = xe_pagefault_service(pf);
 
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))

do we really need to check after?

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 666

Quoted 3 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
+			continue;
+
 		if (err) {

now this err far from where it is collected is pretty bad...

Quoted 5 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
 			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
 				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
#15 lore raw

Re: [PATCH 03/13] drm/xe: Drop queued page faults when device I/O is blocked

Quoted 49 lines · Rodrigo Vivi
Quoted 48 lines · Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
  1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +21 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
  	xe_vm_put(vm);
  }
 
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
Quoted 8 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p · line 621

Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +6 -0
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;

is there some helper we could re-use? I know we cannot use the pop directly, because it would deadlock, but perhaps we can unify some code here...

Noted,

Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/xe/xe_pagefault.c +5 -0
+	}
+
+	return true;
+}
+
  static void xe_pagefault_queue_work(struct work_struct *w)
  {
  	struct xe_pagefault_work *pf_work =
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
  		int err = 0;
  		bool invalidated = false;
 
Quoted 4 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 652

Quoted 3 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;

do we really need to loop inside the loop or only check and let this main loop goes?

Yes, The inner walk is needed. Chained faults have already been removed from the queue and linked through consumer.next. The outer pop loop will not see them.

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/xe/xe_pagefault.c +1 -0
+
  		/* Last fault same address, ack immediately */
  		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
  			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
 
Quoted 5 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 663

Quoted 4 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
  		err = xe_pagefault_service(pf);
 
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))

do we really need to check after?

Yes. The device can enter reset or become wedged while xe_pagefault_service() is running. The first check alone does not cover that race.

Quoted 5 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 666

Quoted 4 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
+			continue;
+
  		if (err) {

now this err far from where it is collected is pretty bad...

Agreed. i will keeps err next to its use.

Thanks,
Arvind

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
  			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
  				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
maintainer
#16 lore raw

Re: [PATCH 03/13] drm/xe: Drop queued page faults when device I/O is blocked

Quoted 50 lines · Arvind
Quoted 48 lines · Rodrigo Vivi
Quoted 47 lines · Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
  1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +21 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
  	xe_vm_put(vm);
  }
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p · line 620

Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +6 -0
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;

is there some helper we could re-use? I know we cannot use the pop directly, because it would deadlock, but perhaps we can unify some code here...

Why would it deadlock... xe_device_io_blocked is just an couple of atomics, right?

So why wouldn't this work to squash all faults.

drivers/gpu/drm/xe/xe_pagefault.c +6 -0
index 2e415995f067..1c9e5539b90d 100644
@@ -477,6 +477,12 @@ static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,
                lpf = xe_pagefault_queue_tail_fault(pf_queue);
                xe_pagefault_queue_advance(pf_queue);
 
+               if (xe_device_io_blocked(xe)) {
+                       lpf->consumer.alloc_state =
+                               XE_PAGEFAULT_ALLOC_STATE_FREE;
+                       continue;
+               }
+
                if (lpf->consumer.alloc_state !=
                    XE_PAGEFAULT_ALLOC_STATE_QUEUED)
                        continue;
Quoted 38 lines

Noted,

Quoted 16 lines
Quoted 10 lines
drivers/gpu/drm/xe/xe_pagefault.c +5 -0
+	}
+
+	return true;
+}
+
  static void xe_pagefault_queue_work(struct work_struct *w)
  {
  	struct xe_pagefault_work *pf_work =

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 651

Quoted 5 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
  		int err = 0;
  		bool invalidated = false;
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;

do we really need to loop inside the loop or only check and let this main loop goes?

Yes, The inner walk is needed. Chained faults have already been removed from the queue and linked through consumer.next. The outer pop loop will not see them.

Quoted 10 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 661

Quoted 9 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
+
  		/* Last fault same address, ack immediately */
  		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
  			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
  		err = xe_pagefault_service(pf);
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))

do we really need to check after?

Quoted 4 lines

Yes. The device can enter reset or become wedged while xe_pagefault_service() is running. The first check alone does not cover that race.

But this is still toctou - really everything in patch is as immediately after either check the state can change. I can't say I'm a fan of any weak checks in this code...

But just for thought: after this point all we do is CT which should be down and we'd drop it there before touching the hardware.

Matt

Quoted 18 lines
Quoted 5 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 664

Quoted 4 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
+			continue;
+
  		if (err) {

now this err far from where it is collected is pretty bad...

Agreed. i will keeps err next to its use.

Thanks,
Arvind

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
  			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
  				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
maintainer
#17 lore raw

Re: [PATCH 03/13] drm/xe: Drop queued page faults when device I/O is blocked

Quoted 70 lines · Matthew Brost
Quoted 50 lines · Arvind
Quoted 48 lines · Rodrigo Vivi
Quoted 47 lines · Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
  1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +21 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
  	xe_vm_put(vm);
  }
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p · line 620

Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +6 -0
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;

is there some helper we could re-use? I know we cannot use the pop directly, because it would deadlock, but perhaps we can unify some code here...

Why would it deadlock... xe_device_io_blocked is just an couple of atomics, right?

So why wouldn't this work to squash all faults.

drivers/gpu/drm/xe/xe_pagefault.c +0 -0
index 2e415995f067..1c9e5539b90d 100644

drivers/gpu/drm/xe/xe_pagefault.c static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue, · line 485

Quoted 9 lines
drivers/gpu/drm/xe/xe_pagefault.c +6 -0
@@ -477,6 +477,12 @@ static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,
                lpf = xe_pagefault_queue_tail_fault(pf_queue);
                xe_pagefault_queue_advance(pf_queue);
 
+               if (xe_device_io_blocked(xe)) {
+                       lpf->consumer.alloc_state =
+                               XE_PAGEFAULT_ALLOC_STATE_FREE;
+                       continue;
+               }
+

^^^ This should actually go after the XE_PAGEFAULT_ALLOC_STATE_QUEUED check.

Matt

Quoted 75 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
                if (lpf->consumer.alloc_state !=
                    XE_PAGEFAULT_ALLOC_STATE_QUEUED)
                        continue;
Quoted 40 lines

Noted,

Quoted 16 lines
Quoted 10 lines
drivers/gpu/drm/xe/xe_pagefault.c +5 -0
+	}
+
+	return true;
+}
+
  static void xe_pagefault_queue_work(struct work_struct *w)
  {
  	struct xe_pagefault_work *pf_work =

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 651

Quoted 5 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
  		int err = 0;
  		bool invalidated = false;
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;

do we really need to loop inside the loop or only check and let this main loop goes?

Yes, The inner walk is needed. Chained faults have already been removed from the queue and linked through consumer.next. The outer pop loop will not see them.

Quoted 10 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 661

Quoted 9 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
+
  		/* Last fault same address, ack immediately */
  		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
  			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
  		err = xe_pagefault_service(pf);
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))

do we really need to check after?

Quoted 4 lines

Yes. The device can enter reset or become wedged while xe_pagefault_service() is running. The first check alone does not cover that race.

But this is still toctou - really everything in patch is as immediately after either check the state can change. I can't say I'm a fan of any weak checks in this code...

But just for thought: after this point all we do is CT which should be down and we'd drop it there before touching the hardware.

Matt

Quoted 18 lines
Quoted 5 lines

drivers/gpu/drm/xe/xe_pagefault.c static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,

Quoted 4 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
+			continue;
+
  		if (err) {

now this err far from where it is collected is pretty bad...

Agreed. i will keeps err next to its use.

Thanks,
Arvind

Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
  			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
  				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
#18 lore raw

Re: [PATCH 03/13] drm/xe: Drop queued page faults when device I/O is blocked

Quoted 59 lines · Matthew Brost
Quoted 58 lines · Matthew Brost
Quoted 57 lines · Arvind
Quoted 56 lines · Rodrigo Vivi
Quoted 43 lines · Arvind Yadav

Page-fault work may still be queued when PCI error recovery starts or the device becomes permanently wedged. Servicing these faults can migrate memory or update page tables after device I/O has been blocked.

Check the device state before and after fault servicing to cover a reset racing with the worker. Drop the active fault and its chained faults without sending a hardware response, and invalidate the cached fault state.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
   drivers/gpu/drm/xe/xe_pagefault.c | 40 +++++++++++++++++++++++++++++++
   1 file changed, 40 insertions(+)
drivers/gpu/drm/xe/xe_pagefault.c +17 -0
index 2e415995f067..f486165f2323 100644
@@ -592,6 +592,38 @@ static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p
   	xe_vm_put(vm);
   }
+static bool
+xe_pagefault_drop_if_blocked(struct xe_pagefault_queue *pf_queue,
+			     struct xe_pagefault_work *pf_work,
+			     struct xe_pagefault *pf,
+			     u64 *cache_start)
+{
+	struct xe_pagefault *next;
+
+	if (!xe_device_io_blocked(pf_work->xe))
+		return false;
+
+	/*
+	 * cache_start is private to this worker invocation. pf_work->cache is
+	 * shared with fault producers and must be invalidated under the queue
+	 * lock.
+	 */
+	xe_pagefault_cache_start_invalidate(*cache_start);

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *p · line 620

Quoted 10 lines
drivers/gpu/drm/xe/xe_pagefault.c +10 -0
+
+	guard(spinlock_irq)(&pf_queue->lock);
+
+	xe_pagefault_cache_invalidate(pf_queue, pf_work);
+
+	while (pf) {
+		next = pf->consumer.next;
+		pf->consumer.next = NULL;
+		pf->consumer.alloc_state = XE_PAGEFAULT_ALLOC_STATE_FREE;
+		pf = next;

is there some helper we could re-use? I know we cannot use the pop directly, because it would deadlock, but perhaps we can unify some code here...

Quoted 4 lines
Quoted 4 lines

Why would it deadlock... xe_device_io_blocked is just an couple of atomics, right?

So why wouldn't this work to squash all faults.

You are right, this does not deadlock  as per you suggestion I will move the check after the QUEUED state check.

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
index 2e415995f067..1c9e5539b90d 100644
@@ -477,6 +477,12 @@ static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,
                 lpf = xe_pagefault_queue_tail_fault(pf_queue);
                 xe_pagefault_queue_advance(pf_queue);
 
Quoted 7 lines

drivers/gpu/drm/xe/xe_pagefault.c static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue, · line 485

Quoted 6 lines
drivers/gpu/drm/xe/xe_pagefault.c +6 -0
+               if (xe_device_io_blocked(xe)) {
+                       lpf->consumer.alloc_state =
+                               XE_PAGEFAULT_ALLOC_STATE_FREE;
+                       continue;
+               }
+

^^^ This should actually go after the XE_PAGEFAULT_ALLOC_STATE_QUEUED check.

Noted,

Arvind

Quoted 69 lines

Matt

Quoted 66 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
                 if (lpf->consumer.alloc_state !=
                     XE_PAGEFAULT_ALLOC_STATE_QUEUED)
                         continue;
Quoted 35 lines

Noted,

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/xe/xe_pagefault.c +5 -0
+	}
+
+	return true;
+}
+
   static void xe_pagefault_queue_work(struct work_struct *w)
   {
Quoted 8 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 651

Quoted 7 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
   	struct xe_pagefault_work *pf_work =
@@ -615,6 +647,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
   		int err = 0;
   		bool invalidated = false;
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))
+			continue;

do we really need to loop inside the loop or only check and let this main loop goes?

Yes, The inner walk is needed. Chained faults have already been removed from the queue and linked through consumer.next. The outer pop loop will not see them.

Quoted 9 lines

drivers/gpu/drm/xe/xe_pagefault.c static void xe_pagefault_queue_work(struct work_struct *w) · line 661

Quoted 8 lines
drivers/gpu/drm/xe/xe_pagefault.c +3 -0
+
   		/* Last fault same address, ack immediately */
   		if (xe_pagefault_match(pf, cache_start, cache_end, cache_asid)) {
   			xe_gt_stats_incr(gt, XE_GT_STATS_ID_LAST_PAGEFAULT_COUNT, 1);
@@ -623,6 +659,10 @@ static void xe_pagefault_queue_work(struct work_struct *w)
   		err = xe_pagefault_service(pf);
+		if (xe_pagefault_drop_if_blocked(pf_queue, pf_work, pf,
+						 &cache_start))

do we really need to check after?

Quoted 4 lines

Yes. The device can enter reset or become wedged while xe_pagefault_service() is running. The first check alone does not cover that race.

But this is still toctou - really everything in patch is as immediately after either check the state can change. I can't say I'm a fan of any weak checks in this code...

But just for thought: after this point all we do is CT which should be down and we'd drop it there before touching the hardware.

Matt

Quoted 15 lines
Quoted 4 lines

drivers/gpu/drm/xe/xe_pagefault.c static bool xe_pagefault_queue_pop(struct xe_pagefault_queue *pf_queue,

Quoted 3 lines
drivers/gpu/drm/xe/xe_pagefault.c +2 -0
+			continue;
+
   		if (err) {

now this err far from where it is collected is pretty bad...

Agreed. i will keeps err next to its use.

Thanks,
Arvind

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/xe/xe_pagefault.c +0 -0
   			if (!(pf->consumer.access_type & XE_PAGEFAULT_ACCESS_PREFETCH)) {
   				xe_pagefault_save_to_vm(gt_to_xe(gt), pf);
Signature · 1 line
2.43.0
#19 lore raw

PATCH 4/13 drm/xe: Stop VM work when device I/O is blocked

In reply to Arvind Yadav

SVM fault handling and VM rebind work may still run when PCI error recovery starts or the device becomes permanently wedged. This work can validate BOs, update page tables or submit migration work after device I/O has been blocked.

Stop SVM fault handling, pagemap population, device-memory copies and preempt rebind work when device I/O is blocked.

SVM invalidation still performs its software cleanup. Do not warn when TLB invalidation returns -ECANCELED because hardware access is blocked.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_svm.c | 21 ++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_vm.c  | 16 ++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_svm.c +20 -1
index 627a741293d5..9e78131bfa39 100644
@@ -11,6 +11,7 @@
 #include <drm/drm_pagemap_util.h>
 
 #include "xe_bo.h"
+#include "xe_device.h"
 #include "xe_exec_queue_types.h"
 #include "xe_gt_stats.h"
 #include "xe_migrate.h"
@@ -288,8 +289,11 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 
 	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
 						 tile_mask, &batch);
-	if (!WARN_ON_ONCE(err))
+	if (!err)
 		xe_tlb_inval_batch_wait(&batch);
+	else if (!(err == -ECANCELED &&
+		   xe_device_io_blocked(xe)))
+		WARN_ON_ONCE(err);
 
 range_notifier_event_end:
 	r = first;
@@ -631,6 +635,11 @@ static int xe_svm_copy(struct page **pages,
 		}
 		XE_WARN_ON(spage && xe_page_to_vr(spage) != vr);
 
+		if (vr && xe_device_io_blocked(xe)) {
+			err = -ECANCELED;
+			goto err_out;
+		}
+
 		/*
 		 * CPU page and device page valid, capture physical address on
 		 * first device page, check if physical contiguous on subsequent
@@ -1125,6 +1134,11 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 	if (!drm_dev_enter(&xe->drm, &idx))
 		return -ENODEV;
 
+	if (xe_device_io_blocked(xe)) {
+		err = -ECANCELED;
+		goto out_drm;
+	}
+
 	xe_pm_runtime_get(xe);
 
 	xe_validation_guard(&vctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
@@ -1165,6 +1179,8 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 		xe_bo_put(bo);
 	}
 	xe_pm_runtime_put(xe);
+
+out_drm:
 	drm_dev_exit(idx);
 
 	return err;
@@ -1301,6 +1317,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
 		drm_gpusvm_range_put(&range->base);
 	}
 
+	if (xe_device_io_blocked(vm->xe))
+		return -ECANCELED;
+
 	/* Always process UNMAPs first so view SVM ranges is current */
 	err = xe_svm_garbage_collector(vm);
 	if (err)
drivers/gpu/drm/xe/xe_vm.c +16 -0
index 19b3d0be7928..0cee5306fb9c 100644
@@ -497,6 +497,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	}
 
 retry:
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock_outer;
+	}
+
 	if (!try_wait_for_completion(&vm->xe->pm_block) && vm_suspend_rebind_worker(vm)) {
 		up_write(&vm->lock);
 		/* We don't actually block but don't make progress. */
@@ -518,6 +523,12 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	drm_exec_until_all_locked(&exec) {
 		bool done = false;
 
+		if (xe_device_io_blocked(vm->xe)) {
+			xe_validation_ctx_fini(&ctx);
+			err = 0;
+			goto out_unlock_outer;
+		}
+
 		err = xe_preempt_work_begin(&exec, vm, &done);
 		drm_exec_retry_on_contention(&exec);
 		xe_validation_retry_on_oom(&ctx, &err);
@@ -531,6 +542,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock;
+	}
+
 	xe_vm_set_validation_exec(vm, &exec);
 	err = xe_vm_rebind(vm, true);
 	xe_vm_set_validation_exec(vm, NULL);
Signature · 1 line
2.43.0
maintainer
#20 lore raw

Re: [PATCH 04/13] drm/xe: Stop VM work when device I/O is blocked

Quoted 35 lines · Arvind Yadav

SVM fault handling and VM rebind work may still run when PCI error recovery starts or the device becomes permanently wedged. This work can validate BOs, update page tables or submit migration work after device I/O has been blocked.

Stop SVM fault handling, pagemap population, device-memory copies and preempt rebind work when device I/O is blocked.

SVM invalidation still performs its software cleanup. Do not warn when TLB invalidation returns -ECANCELED because hardware access is blocked.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_svm.c | 21 ++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_vm.c  | 16 ++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 627a741293d5..9e78131bfa39 100644
@@ -11,6 +11,7 @@
 #include <drm/drm_pagemap_util.h>
 
 #include "xe_bo.h"
+#include "xe_device.h"
 #include "xe_exec_queue_types.h"
 #include "xe_gt_stats.h"
 #include "xe_migrate.h"

drivers/gpu/drm/xe/xe_svm.c static void xe_svm_invalidate(struct drm_gpusvm *gpusvm, · line 296

Quoted 9 lines
drivers/gpu/drm/xe/xe_svm.c +4 -1
@@ -288,8 +289,11 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 
 	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
 						 tile_mask, &batch);
-	if (!WARN_ON_ONCE(err))
+	if (!err)
 		xe_tlb_inval_batch_wait(&batch);
+	else if (!(err == -ECANCELED &&
+		   xe_device_io_blocked(xe)))
+		WARN_ON_ONCE(err);

if (!err)

        xe_tlb_inval_batch_wait(&batch);
else
        WARN_ON_ONCE(err != -ECANCELED ||
                     !xe_device_io_blocked(xe));
Quoted 90 lines
drivers/gpu/drm/xe/xe_svm.c +15 -0
 range_notifier_event_end:
 	r = first;
@@ -631,6 +635,11 @@ static int xe_svm_copy(struct page **pages,
 		}
 		XE_WARN_ON(spage && xe_page_to_vr(spage) != vr);
 
+		if (vr && xe_device_io_blocked(xe)) {
+			err = -ECANCELED;
+			goto err_out;
+		}
+
 		/*
 		 * CPU page and device page valid, capture physical address on
 		 * first device page, check if physical contiguous on subsequent
@@ -1125,6 +1134,11 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 	if (!drm_dev_enter(&xe->drm, &idx))
 		return -ENODEV;
 
+	if (xe_device_io_blocked(xe)) {
+		err = -ECANCELED;
+		goto out_drm;
+	}
+
 	xe_pm_runtime_get(xe);
 
 	xe_validation_guard(&vctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
@@ -1165,6 +1179,8 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
 		xe_bo_put(bo);
 	}
 	xe_pm_runtime_put(xe);
+
+out_drm:
 	drm_dev_exit(idx);
 
 	return err;
@@ -1301,6 +1317,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
 		drm_gpusvm_range_put(&range->base);
 	}
 
+	if (xe_device_io_blocked(vm->xe))
+		return -ECANCELED;
+
 	/* Always process UNMAPs first so view SVM ranges is current */
 	err = xe_svm_garbage_collector(vm);
 	if (err)
drivers/gpu/drm/xe/xe_vm.c +16 -0
index 19b3d0be7928..0cee5306fb9c 100644
@@ -497,6 +497,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	}
 
 retry:
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock_outer;
+	}
+
 	if (!try_wait_for_completion(&vm->xe->pm_block) && vm_suspend_rebind_worker(vm)) {
 		up_write(&vm->lock);
 		/* We don't actually block but don't make progress. */
@@ -518,6 +523,12 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	drm_exec_until_all_locked(&exec) {
 		bool done = false;
 
+		if (xe_device_io_blocked(vm->xe)) {
+			xe_validation_ctx_fini(&ctx);
+			err = 0;
+			goto out_unlock_outer;
+		}
+
 		err = xe_preempt_work_begin(&exec, vm, &done);
 		drm_exec_retry_on_contention(&exec);
 		xe_validation_retry_on_oom(&ctx, &err);
@@ -531,6 +542,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
 	if (err)
 		goto out_unlock;
 
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock;
+	}
+
 	xe_vm_set_validation_exec(vm, &exec);
 	err = xe_vm_rebind(vm, true);
 	xe_vm_set_validation_exec(vm, NULL);
Signature · 1 line
2.43.0
#21 lore raw

Re: [PATCH 04/13] drm/xe: Stop VM work when device I/O is blocked

Quoted 46 lines · Rodrigo Vivi
Quoted 35 lines · Arvind Yadav

SVM fault handling and VM rebind work may still run when PCI error recovery starts or the device becomes permanently wedged. This work can validate BOs, update page tables or submit migration work after device I/O has been blocked.

Stop SVM fault handling, pagemap population, device-memory copies and preempt rebind work when device I/O is blocked.

SVM invalidation still performs its software cleanup. Do not warn when TLB invalidation returns -ECANCELED because hardware access is blocked.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_svm.c | 21 ++++++++++++++++++++-
  drivers/gpu/drm/xe/xe_vm.c  | 16 ++++++++++++++++
  2 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 627a741293d5..9e78131bfa39 100644
@@ -11,6 +11,7 @@
  #include <drm/drm_pagemap_util.h>
 
  #include "xe_bo.h"
+#include "xe_device.h"
  #include "xe_exec_queue_types.h"
  #include "xe_gt_stats.h"
  #include "xe_migrate.h"

drivers/gpu/drm/xe/xe_svm.c static void xe_svm_invalidate(struct drm_gpusvm *gpusvm, · line 296

Quoted 9 lines
drivers/gpu/drm/xe/xe_svm.c +4 -1
@@ -288,8 +289,11 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
 
  	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
  						 tile_mask, &batch);
-	if (!WARN_ON_ONCE(err))
+	if (!err)
  		xe_tlb_inval_batch_wait(&batch);
+	else if (!(err == -ECANCELED &&
+		   xe_device_io_blocked(xe)))
+		WARN_ON_ONCE(err);

if (!err)

Quoted 4 lines
         xe_tlb_inval_batch_wait(&batch);
else
         WARN_ON_ONCE(err != -ECANCELED ||
                      !xe_device_io_blocked(xe));

Noted.

Thanks,
Arvind

Quoted 91 lines
Quoted 91 lines
drivers/gpu/drm/xe/xe_svm.c +15 -0
  range_notifier_event_end:
  	r = first;
@@ -631,6 +635,11 @@ static int xe_svm_copy(struct page **pages,
  		}
  		XE_WARN_ON(spage && xe_page_to_vr(spage) != vr);
 
+		if (vr && xe_device_io_blocked(xe)) {
+			err = -ECANCELED;
+			goto err_out;
+		}
+
  		/*
  		 * CPU page and device page valid, capture physical address on
  		 * first device page, check if physical contiguous on subsequent
@@ -1125,6 +1134,11 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
  	if (!drm_dev_enter(&xe->drm, &idx))
  		return -ENODEV;
 
+	if (xe_device_io_blocked(xe)) {
+		err = -ECANCELED;
+		goto out_drm;
+	}
+
  	xe_pm_runtime_get(xe);
 
  	xe_validation_guard(&vctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
@@ -1165,6 +1179,8 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
  		xe_bo_put(bo);
  	}
  	xe_pm_runtime_put(xe);
+
+out_drm:
  	drm_dev_exit(idx);
 
  	return err;
@@ -1301,6 +1317,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
  		drm_gpusvm_range_put(&range->base);
  	}
 
+	if (xe_device_io_blocked(vm->xe))
+		return -ECANCELED;
+
  	/* Always process UNMAPs first so view SVM ranges is current */
  	err = xe_svm_garbage_collector(vm);
  	if (err)
drivers/gpu/drm/xe/xe_vm.c +16 -0
index 19b3d0be7928..0cee5306fb9c 100644
@@ -497,6 +497,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	}
 
  retry:
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock_outer;
+	}
+
  	if (!try_wait_for_completion(&vm->xe->pm_block) && vm_suspend_rebind_worker(vm)) {
  		up_write(&vm->lock);
  		/* We don't actually block but don't make progress. */
@@ -518,6 +523,12 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	drm_exec_until_all_locked(&exec) {
  		bool done = false;
 
+		if (xe_device_io_blocked(vm->xe)) {
+			xe_validation_ctx_fini(&ctx);
+			err = 0;
+			goto out_unlock_outer;
+		}
+
  		err = xe_preempt_work_begin(&exec, vm, &done);
  		drm_exec_retry_on_contention(&exec);
  		xe_validation_retry_on_oom(&ctx, &err);
@@ -531,6 +542,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	if (err)
  		goto out_unlock;
 
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock;
+	}
+
  	xe_vm_set_validation_exec(vm, &exec);
  	err = xe_vm_rebind(vm, true);
  	xe_vm_set_validation_exec(vm, NULL);
Signature · 1 line
2.43.0
maintainer
#22 lore raw

Re: [PATCH 04/13] drm/xe: Stop VM work when device I/O is blocked

Quoted 58 lines · Arvind
Quoted 44 lines · Rodrigo Vivi
Quoted 34 lines · Arvind Yadav

SVM fault handling and VM rebind work may still run when PCI error recovery starts or the device becomes permanently wedged. This work can validate BOs, update page tables or submit migration work after device I/O has been blocked.

Stop SVM fault handling, pagemap population, device-memory copies and preempt rebind work when device I/O is blocked.

SVM invalidation still performs its software cleanup. Do not warn when TLB invalidation returns -ECANCELED because hardware access is blocked.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_svm.c | 21 ++++++++++++++++++++-
  drivers/gpu/drm/xe/xe_vm.c  | 16 ++++++++++++++++
  2 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 627a741293d5..9e78131bfa39 100644
@@ -11,6 +11,7 @@
  #include <drm/drm_pagemap_util.h>
  #include "xe_bo.h"
+#include "xe_device.h"
  #include "xe_exec_queue_types.h"
  #include "xe_gt_stats.h"
  #include "xe_migrate.h"

drivers/gpu/drm/xe/xe_svm.c static void xe_svm_invalidate(struct drm_gpusvm *gpusvm, · line 295

Quoted 8 lines
drivers/gpu/drm/xe/xe_svm.c +4 -1
@@ -288,8 +289,11 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
  	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
  						 tile_mask, &batch);
-	if (!WARN_ON_ONCE(err))
+	if (!err)
  		xe_tlb_inval_batch_wait(&batch);
+	else if (!(err == -ECANCELED &&
+		   xe_device_io_blocked(xe)))
+		WARN_ON_ONCE(err);

if (!err)

Quoted 4 lines
         xe_tlb_inval_batch_wait(&batch);
else
         WARN_ON_ONCE(err != -ECANCELED ||
                      !xe_device_io_blocked(xe));

Noted.

Thanks,
Arvind

Quoted 1 line
Quoted 10 lines
Quoted 10 lines

drivers/gpu/drm/xe/xe_svm.c static int xe_svm_copy(struct page **pages, · line 641

Quoted 10 lines
drivers/gpu/drm/xe/xe_svm.c +5 -0
  range_notifier_event_end:
  	r = first;
@@ -631,6 +635,11 @@ static int xe_svm_copy(struct page **pages,
  		}
  		XE_WARN_ON(spage && xe_page_to_vr(spage) != vr);
+		if (vr && xe_device_io_blocked(xe)) {
+			err = -ECANCELED;
+			goto err_out;
+		}
+

Again a toctou given this state can immediately change.

Unless I'm missing something - my answer is basically no, likely for the entire series unless this is a non-toctou check as otherwise we just have a bunch of weakly ordered checks throughout the driver which don't actually protect anything.

Matt

Quoted 71 lines
Quoted 71 lines
Quoted 71 lines
drivers/gpu/drm/xe/xe_svm.c +10 -0
  		/*
  		 * CPU page and device page valid, capture physical address on
  		 * first device page, check if physical contiguous on subsequent
@@ -1125,6 +1134,11 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
  	if (!drm_dev_enter(&xe->drm, &idx))
  		return -ENODEV;
+	if (xe_device_io_blocked(xe)) {
+		err = -ECANCELED;
+		goto out_drm;
+	}
+
  	xe_pm_runtime_get(xe);
  	xe_validation_guard(&vctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
@@ -1165,6 +1179,8 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
  		xe_bo_put(bo);
  	}
  	xe_pm_runtime_put(xe);
+
+out_drm:
  	drm_dev_exit(idx);
  	return err;
@@ -1301,6 +1317,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
  		drm_gpusvm_range_put(&range->base);
  	}
+	if (xe_device_io_blocked(vm->xe))
+		return -ECANCELED;
+
  	/* Always process UNMAPs first so view SVM ranges is current */
  	err = xe_svm_garbage_collector(vm);
  	if (err)
drivers/gpu/drm/xe/xe_vm.c +16 -0
index 19b3d0be7928..0cee5306fb9c 100644
@@ -497,6 +497,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	}
  retry:
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock_outer;
+	}
+
  	if (!try_wait_for_completion(&vm->xe->pm_block) && vm_suspend_rebind_worker(vm)) {
  		up_write(&vm->lock);
  		/* We don't actually block but don't make progress. */
@@ -518,6 +523,12 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	drm_exec_until_all_locked(&exec) {
  		bool done = false;
+		if (xe_device_io_blocked(vm->xe)) {
+			xe_validation_ctx_fini(&ctx);
+			err = 0;
+			goto out_unlock_outer;
+		}
+
  		err = xe_preempt_work_begin(&exec, vm, &done);
  		drm_exec_retry_on_contention(&exec);
  		xe_validation_retry_on_oom(&ctx, &err);
@@ -531,6 +542,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
  	if (err)
  		goto out_unlock;
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock;
+	}
+
  	xe_vm_set_validation_exec(vm, &exec);
  	err = xe_vm_rebind(vm, true);
  	xe_vm_set_validation_exec(vm, NULL);
Signature · 1 line
2.43.0
#23 lore raw

Re: [PATCH 04/13] drm/xe: Stop VM work when device I/O is blocked

Quoted 68 lines · Matthew Brost
Quoted 55 lines · Arvind
Quoted 44 lines · Rodrigo Vivi
Quoted 34 lines · Arvind Yadav

SVM fault handling and VM rebind work may still run when PCI error recovery starts or the device becomes permanently wedged. This work can validate BOs, update page tables or submit migration work after device I/O has been blocked.

Stop SVM fault handling, pagemap population, device-memory copies and preempt rebind work when device I/O is blocked.

SVM invalidation still performs its software cleanup. Do not warn when TLB invalidation returns -ECANCELED because hardware access is blocked.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
   drivers/gpu/drm/xe/xe_svm.c | 21 ++++++++++++++++++++-
   drivers/gpu/drm/xe/xe_vm.c  | 16 ++++++++++++++++
   2 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_svm.c +1 -0
index 627a741293d5..9e78131bfa39 100644
@@ -11,6 +11,7 @@
   #include <drm/drm_pagemap_util.h>
   #include "xe_bo.h"
+#include "xe_device.h"
   #include "xe_exec_queue_types.h"
   #include "xe_gt_stats.h"
   #include "xe_migrate.h"

drivers/gpu/drm/xe/xe_svm.c static void xe_svm_invalidate(struct drm_gpusvm *gpusvm, · line 295

Quoted 8 lines
drivers/gpu/drm/xe/xe_svm.c +4 -1
@@ -288,8 +289,11 @@ static void xe_svm_invalidate(struct drm_gpusvm *gpusvm,
   	err = xe_tlb_inval_range_tilemask_submit(xe, vm->usm.asid, adj_start, adj_end,
   						 tile_mask, &batch);
-	if (!WARN_ON_ONCE(err))
+	if (!err)
   		xe_tlb_inval_batch_wait(&batch);
+	else if (!(err == -ECANCELED &&
+		   xe_device_io_blocked(xe)))
+		WARN_ON_ONCE(err);

if (!err)

Quoted 4 lines
          xe_tlb_inval_batch_wait(&batch);
else
          WARN_ON_ONCE(err != -ECANCELED ||
                       !xe_device_io_blocked(xe));

Noted.

Thanks,
Arvind

Quoted 10 lines
Quoted 10 lines

drivers/gpu/drm/xe/xe_svm.c static int xe_svm_copy(struct page **pages, · line 641

Quoted 10 lines
drivers/gpu/drm/xe/xe_svm.c +5 -0
   range_notifier_event_end:
   	r = first;
@@ -631,6 +635,11 @@ static int xe_svm_copy(struct page **pages,
   		}
   		XE_WARN_ON(spage && xe_page_to_vr(spage) != vr);
+		if (vr && xe_device_io_blocked(xe)) {
+			err = -ECANCELED;
+			goto err_out;
+		}
+

Again a toctou given this state can immediately change.

Quoted 4 lines

Unless I'm missing something - my answer is basically no, likely for the entire series unless this is a non-toctou check as otherwise we just have a bunch of weakly ordered checks throughout the driver which don't actually protect anything.

Agreed.  I will rework the series to block new access and drain active hardware users before reset or wedge.

Thanks,
Arvind

Quoted 74 lines

Matt

Quoted 71 lines
Quoted 71 lines
Quoted 71 lines
drivers/gpu/drm/xe/xe_svm.c +10 -0
   		/*
   		 * CPU page and device page valid, capture physical address on
   		 * first device page, check if physical contiguous on subsequent
@@ -1125,6 +1134,11 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
   	if (!drm_dev_enter(&xe->drm, &idx))
   		return -ENODEV;
+	if (xe_device_io_blocked(xe)) {
+		err = -ECANCELED;
+		goto out_drm;
+	}
+
   	xe_pm_runtime_get(xe);
   	xe_validation_guard(&vctx, &xe->val, &exec, (struct xe_val_flags) {}, err) {
@@ -1165,6 +1179,8 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
   		xe_bo_put(bo);
   	}
   	xe_pm_runtime_put(xe);
+
+out_drm:
   	drm_dev_exit(idx);
   	return err;
@@ -1301,6 +1317,9 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
   		drm_gpusvm_range_put(&range->base);
   	}
+	if (xe_device_io_blocked(vm->xe))
+		return -ECANCELED;
+
   	/* Always process UNMAPs first so view SVM ranges is current */
   	err = xe_svm_garbage_collector(vm);
   	if (err)
drivers/gpu/drm/xe/xe_vm.c +16 -0
index 19b3d0be7928..0cee5306fb9c 100644
@@ -497,6 +497,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
   	}
   retry:
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock_outer;
+	}
+
   	if (!try_wait_for_completion(&vm->xe->pm_block) && vm_suspend_rebind_worker(vm)) {
   		up_write(&vm->lock);
   		/* We don't actually block but don't make progress. */
@@ -518,6 +523,12 @@ static void preempt_rebind_work_func(struct work_struct *w)
   	drm_exec_until_all_locked(&exec) {
   		bool done = false;
+		if (xe_device_io_blocked(vm->xe)) {
+			xe_validation_ctx_fini(&ctx);
+			err = 0;
+			goto out_unlock_outer;
+		}
+
   		err = xe_preempt_work_begin(&exec, vm, &done);
   		drm_exec_retry_on_contention(&exec);
   		xe_validation_retry_on_oom(&ctx, &err);
@@ -531,6 +542,11 @@ static void preempt_rebind_work_func(struct work_struct *w)
   	if (err)
   		goto out_unlock;
+	if (xe_device_io_blocked(vm->xe)) {
+		err = 0;
+		goto out_unlock;
+	}
+
   	xe_vm_set_validation_exec(vm, &exec);
   	err = xe_vm_rebind(vm, true);
   	xe_vm_set_validation_exec(vm, NULL);
Signature · 1 line
2.43.0
#24 lore raw

PATCH 5/13 drm/xe: Send wedged notification from a worker

In reply to Arvind Yadav

Move the wedged event to a device worker. This provides a sleepable context for later isolation work and allows it to complete before userspace is notified.

Keep one-time wedge bookkeeping on the first transition, but rescan the GT state on later declarations because the recovery method may change. For example, survivability handling can add VENDOR recovery after an earlier REBIND notification.

Track the last reported method and resample it after each event so an update is not lost when the worker is already running.

Drain the worker before probe cleanup, remove, shutdown and IRQ teardown to prevent it from racing device teardown.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_device.c       | 77 +++++++++++++++++++++++-----
 drivers/gpu/drm/xe/xe_device_types.h |  4 ++
 2 files changed, 67 insertions(+), 14 deletions(-)
drivers/gpu/drm/xe/xe_device.c +63 -14
index a92e90acdf0d..ffbaf85eaab1 100644
@@ -83,6 +83,8 @@
 #include <generated/xe_device_wa_oob.h>
 #include <generated/xe_wa_oob.h>
 
+static void xe_device_wedged_work(struct work_struct *work);
+
 static int xe_file_open(struct drm_device *dev, struct drm_file *file)
 {
 	struct xe_device *xe = to_xe_device(dev);
@@ -535,6 +537,9 @@ int xe_device_init_early(struct xe_device *xe)
 {
 	int err;
 
+	INIT_WORK(&xe->wedged.work, xe_device_wedged_work);
+	xe->wedged.reported_method = ~0UL;
+
 	err = ttm_device_init(&xe->ttm, &xe_ttm_funcs, xe->drm.dev,
 			      xe->drm.anon_inode->i_mapping,
 			      xe->drm.vma_offset_manager,
@@ -953,6 +958,35 @@ static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
 }
 #endif
 
+static void xe_device_wedged_work(struct work_struct *work)
+{
+	struct xe_device *xe =
+			container_of(work, struct xe_device, wedged.work);
+	unsigned long method;
+
+	/* Report at most one recovery method per worker invocation. */
+	method = READ_ONCE(xe->wedged.method);
+	if (method != READ_ONCE(xe->wedged.reported_method)) {
+		drm_dev_wedged_event(&xe->drm, method, NULL);
+		WRITE_ONCE(xe->wedged.reported_method, method);
+	}
+
+	/*
+	 * Queue another pass if the method changed while the event was sent.
+	 * This preserves the update without keeping this worker in a loop.
+	 */
+	if (READ_ONCE(xe->wedged.method) !=
+	    READ_ONCE(xe->wedged.reported_method))
+		queue_work(xe->unordered_wq, &xe->wedged.work);
+}
+
+static void xe_device_wedged_disable(void *arg)
+{
+	struct xe_device *xe = arg;
+
+	disable_work_sync(&xe->wedged.work);
+}
+
 int xe_device_probe(struct xe_device *xe)
 {
 	struct xe_tile *tile;
@@ -1061,6 +1095,12 @@ int xe_device_probe(struct xe_device *xe)
 	if (err)
 		return err;
 
+	/* Drain wedge work before irq_uninstall() during devres unwind. */
+	err = devm_add_action_or_reset(xe->drm.dev,
+				       xe_device_wedged_disable, xe);
+	if (err)
+		return err;
+
 	for_each_gt(gt, xe, id) {
 		err = xe_gt_init(gt);
 		if (err)
@@ -1166,6 +1206,7 @@ int xe_device_probe(struct xe_device *xe)
 	return 0;
 
 err_unregister_display:
+	xe_device_wedged_disable(xe);
 	xe_display_unregister(xe);
 	drm_dev_unregister(&xe->drm);
 
@@ -1174,6 +1215,8 @@ int xe_device_probe(struct xe_device *xe)
 
 void xe_device_remove(struct xe_device *xe)
 {
+	xe_device_wedged_disable(xe);
+
 	xe_display_unregister(xe);
 
 	drm_dev_unplug(&xe->drm);
@@ -1188,6 +1231,8 @@ void xe_device_shutdown(struct xe_device *xe)
 
 	drm_dbg(&xe->drm, "Shutting down device\n");
 
+	xe_device_wedged_disable(xe);
+
 	xe_display_shutdown(xe);
 
 	xe_irq_suspend(xe);
@@ -1440,7 +1485,7 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
  */
 void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
 {
-	xe->wedged.method = method;
+	WRITE_ONCE(xe->wedged.method, method);
 }
 
 #define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
@@ -1467,6 +1512,7 @@ void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
 void xe_device_declare_wedged(struct xe_device *xe)
 {
 	struct xe_gt *gt;
+	bool first;
 	u8 id;
 
 	if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
@@ -1474,7 +1520,8 @@ void xe_device_declare_wedged(struct xe_device *xe)
 		return;
 	}
 
-	if (!atomic_xchg(&xe->wedged.flag, 1)) {
+	first = !atomic_xchg(&xe->wedged.flag, 1);
+	if (first) {
 		xe->needs_flr_on_fini = true;
 		xe_pm_runtime_get_noresume(xe);
 
@@ -1483,12 +1530,7 @@ void xe_device_declare_wedged(struct xe_device *xe)
 			    "For recovery procedure, refer to %s\n"
 			    "Please file a _new_ bug report at %s\n",
 			    WEDGED_URL, XE_BUG_URL);
-	}
-
-	for_each_gt(gt, xe, id)
-		xe_gt_declare_wedged(gt);
 
-	if (xe_device_wedged(xe)) {
 		/*
 		 * XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET is intended for debugging
 		 * hangs, so wedge the device with 'none' recovery method and have
@@ -1496,14 +1538,21 @@ void xe_device_declare_wedged(struct xe_device *xe)
 		 */
 		if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
 			xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_NONE);
-		/* If no wedge recovery method is set, use default */
-		else if (!xe->wedged.method)
-			xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_REBIND |
-						    DRM_WEDGE_RECOVERY_BUS_RESET);
-
-		/* Notify userspace of wedged device */
-		drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL);
 	}
+
+	/* Re-scan GT submission state on every declaration. */
+	for_each_gt(gt, xe, id)
+		xe_gt_declare_wedged(gt);
+
+	/* If no wedge recovery method is set, use default */
+	if (!READ_ONCE(xe->wedged.method))
+		xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_REBIND |
+					    DRM_WEDGE_RECOVERY_BUS_RESET);
+
+	if (first ||
+	    READ_ONCE(xe->wedged.method) !=
+	    READ_ONCE(xe->wedged.reported_method))
+		queue_work(xe->unordered_wq, &xe->wedged.work);
 }
 
 /**
drivers/gpu/drm/xe/xe_device_types.h +4 -0
index 180d450a6deb..382a2b470647 100644
@@ -534,6 +534,10 @@ struct xe_device {
 		unsigned long method;
 		/** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
 		bool inconsistent_reset;
+		/** @wedged.work: Runs sleepable wedge handling */
+		struct work_struct work;
+		/** @wedged.reported_method: Last recovery method reported to userspace */
+		unsigned long reported_method;
 	} wedged;
 
 	/** @devres_group: devres group */
Signature · 1 line
2.43.0
#25 lore raw

Re: [PATCH 05/13] drm/xe: Send wedged notification from a worker

Hi Arvind,

...

drivers/gpu/drm/xe/xe_device.c static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe) · line 971

Quoted 11 lines
drivers/gpu/drm/xe/xe_device.c +11 -0
+static void xe_device_wedged_work(struct work_struct *work)
+{
+	struct xe_device *xe =
+			container_of(work, struct xe_device, wedged.work);
+	unsigned long method;
+
+	/* Report at most one recovery method per worker invocation. */
+	method = READ_ONCE(xe->wedged.method);
+	if (method != READ_ONCE(xe->wedged.reported_method)) {
+		drm_dev_wedged_event(&xe->drm, method, NULL);
+		WRITE_ONCE(xe->wedged.reported_method, method);

I think we need to check the error from drm_dev_wedged_event():

		int err;

		err = drm_dev_wedged_event(&xe->drm, method, NULL);
		if (!err)
			WRITE_ONCE(xe->wedged.reported_method, method);

Andi

Quoted 1 line
(quoted diff) +1 -0
+	}
#26 lore raw

Re: [PATCH 05/13] drm/xe: Send wedged notification from a worker

Quoted 17 lines · Andi Shyti

Hi Arvind,

...

drivers/gpu/drm/xe/xe_device.c static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe) · line 971

Quoted 11 lines
drivers/gpu/drm/xe/xe_device.c +11 -0
+static void xe_device_wedged_work(struct work_struct *work)
+{
+	struct xe_device *xe =
+			container_of(work, struct xe_device, wedged.work);
+	unsigned long method;
+
+	/* Report at most one recovery method per worker invocation. */
+	method = READ_ONCE(xe->wedged.method);
+	if (method != READ_ONCE(xe->wedged.reported_method)) {
+		drm_dev_wedged_event(&xe->drm, method, NULL);
+		WRITE_ONCE(xe->wedged.reported_method, method);

I think we need to check the error from drm_dev_wedged_event():

Quoted 5 lines
		int err;

		err = drm_dev_wedged_event(&xe->drm, method, NULL);
		if (!err)
			WRITE_ONCE(xe->wedged.reported_method, method);

Thanks, agreed.
I will update reported_method only when drm_dev_wedged_event() succeeds.

Arvind

Quoted 4 lines

Andi

Quoted 1 line
(quoted diff) +1 -0
+	}
#27 lore raw

PATCH 6/13 drm/xe: Reuse one dummy page per BO after wedge

In reply to Arvind Yadav

ttm_bo_vm_dummy_page() allocates a page and a managed cleanup action on every call. These allocations remain until the DRM device is released, so repeated fallback faults can retain many pages.

Keep one zeroed dummy page in each Xe BO and reuse it when device I/O is blocked or the device is unplugged. Use cmpxchg() to handle concurrent faults and free the page when the BO is destroyed.

Map the faulting address first and return any error from that operation. Prefault the rest of the VMA as a best-effort optimization.

A per-BO page also prevents writable mappings from different BOs from sharing data.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_bo.c       | 51 +++++++++++++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_bo_types.h |  4 +++
 2 files changed, 54 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_bo.c +50 -1
index b86cd6030ed6..1f6ea9f5afe6 100644
@@ -1876,6 +1876,9 @@ static void xe_ttm_bo_destroy(struct ttm_buffer_object *ttm_bo)
 		list_del(&bo->vram_userfault_link);
 	mutex_unlock(&xe->mem_access.vram_userfault.lock);
 
+	if (bo->wedged_dummy_page)
+		__free_page(bo->wedged_dummy_page);
+
 	kfree(bo);
 }
 
@@ -2080,6 +2083,50 @@ static vm_fault_t xe_bo_cpu_fault_fastpath(struct vm_fault *vmf, struct xe_devic
 	return ret;
 }
 
+static vm_fault_t xe_bo_vm_dummy_page(struct vm_fault *vmf, struct xe_bo *bo)
+{
+	struct vm_area_struct *vma = vmf->vma;
+	struct page *page, *old;
+	unsigned long address;
+	unsigned long pfn;
+	vm_fault_t ret, prefault_ret;
+
+	page = READ_ONCE(bo->wedged_dummy_page);
+	if (!page) {
+		page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+		if (!page)
+			return VM_FAULT_OOM;
+
+		old = cmpxchg(&bo->wedged_dummy_page, NULL, page);
+		if (old) {
+			__free_page(page);
+			page = old;
+		}
+	}
+
+	pfn = page_to_pfn(page);
+
+	/* The faulting address must be mapped successfully. */
+	ret = vmf_insert_pfn_prot(vma, vmf->address, pfn,
+				  vma->vm_page_prot);
+	if (ret & VM_FAULT_ERROR)
+		return ret;
+
+	/* Prefault the remaining VMA as a best-effort optimization. */
+	for (address = vma->vm_start; address < vma->vm_end;
+	     address += PAGE_SIZE) {
+		if (address == vmf->address)
+			continue;
+
+		prefault_ret = vmf_insert_pfn_prot(vma, address, pfn,
+						   vma->vm_page_prot);
+		if (prefault_ret & VM_FAULT_ERROR)
+			break;
+	}
+
+	return ret;
+}
+
 static vm_fault_t xe_bo_cpu_fault(struct vm_fault *vmf)
 {
 	struct ttm_buffer_object *tbo = vmf->vma->vm_private_data;
@@ -2095,7 +2142,7 @@ static vm_fault_t xe_bo_cpu_fault(struct vm_fault *vmf)
 	int idx;
 
 	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx))
-		return ttm_bo_vm_dummy_page(vmf, vmf->vma->vm_page_prot);
+		return xe_bo_vm_dummy_page(vmf, bo);
 
 	ret = xe_bo_cpu_fault_fastpath(vmf, xe, bo, needs_rpm);
 	if (ret != VM_FAULT_RETRY)
@@ -2385,6 +2432,8 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo,
 			return bo;
 	}
 
+	bo->wedged_dummy_page = NULL;
+
 	bo->ccs_cleared = false;
 	bo->tile = tile;
 	bo->flags = flags;
drivers/gpu/drm/xe/xe_bo_types.h +4 -0
index e45f24301050..82ee171ea6de 100644
@@ -20,6 +20,7 @@
 struct xe_device;
 struct xe_mem_pool_node;
 struct xe_vm;
+struct page;
 
 #define XE_BO_MAX_PLACEMENTS	3
 
@@ -106,6 +107,9 @@ struct xe_bo {
 	/** @vram_userfault_link: Link into @mem_access.vram_userfault.list */
 	struct list_head vram_userfault_link;
 
+	/** @wedged_dummy_page: Zeroed page used for faults after device wedge */
+	struct page *wedged_dummy_page;
+
 	/**
 	 * @min_align: minimum alignment needed for this BO if different
 	 * from default
Signature · 1 line
2.43.0
#28 lore raw

Re: [PATCH 06/13] drm/xe: Reuse one dummy page per BO after wedge

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Unbounded VMA prefaulting loop causes CPU starvation and soft lockups. --

commit 359edbd46613b71dc869a156d98f9fb5a002a599
Author: Arvind Yadav <[email protected]>

drm/xe: Reuse one dummy page per BO after wedge

This commit replaces the allocation of a dummy page on every call to ttm_bo_vm_dummy_page() with a single zeroed page kept per BO. It maps the faulting address first and then prefaults the rest of the VMA as a best-effort optimization.

Quoted 4 lines
drivers/gpu/drm/xe/xe_bo.c +0 -0
index b86cd6030ed6b..1f6ea9f5afe62 100644

[ ... ]

Quoted 7 lines
drivers/gpu/drm/xe/xe_bo.c +3 -0
@@ -2080,6 +2083,50 @@ static vm_fault_t xe_bo_cpu_fault_fastpath(struct vm_fault *vmf, struct xe_devic
 	return ret;
 }
 
+static vm_fault_t xe_bo_vm_dummy_page(struct vm_fault *vmf, struct xe_bo *bo)
+{
+	struct vm_area_struct *vma = vmf->vma;

[ ... ]

drivers/gpu/drm/xe/xe_bo.c static vm_fault_t xe_bo_cpu_fault_fastpath(struct vm_fault *vmf, struct xe_devic · line 2117

Quoted 9 lines
drivers/gpu/drm/xe/xe_bo.c +9 -0
+	/* The faulting address must be mapped successfully. */
+	ret = vmf_insert_pfn_prot(vma, vmf->address, pfn,
+				  vma->vm_page_prot);
+	if (ret & VM_FAULT_ERROR)
+		return ret;
+
+	/* Prefault the remaining VMA as a best-effort optimization. */
+	for (address = vma->vm_start; address < vma->vm_end;
+	     address += PAGE_SIZE) {

[Severity: High]
This is a pre-existing issue, but does this unbounded loop risk causing CPU starvation and soft lockups?

When a user allocates and mmaps a very large BO, and the device becomes wedged, a page fault will call xe_bo_cpu_fault() and trigger this path in xe_bo_vm_dummy_page(). For huge buffer objects (e.g., tens of gigabytes), iterating millions of times to insert PTEs without yielding points or signal checks can cause severe CPU starvation and watchdog soft lockups. This can also make the faulting task temporarily unkillable while stalling concurrent mmap_write_lock() requests.

This behavior was inherited from ttm_bo_vm_dummy_page(), but should this loop be bounded or conditionally yield?

Quoted 11 lines
drivers/gpu/drm/xe/xe_bo.c +11 -0
+		if (address == vmf->address)
+			continue;
+
+		prefault_ret = vmf_insert_pfn_prot(vma, address, pfn,
+						   vma->vm_page_prot);
+		if (prefault_ret & VM_FAULT_ERROR)
+			break;
+	}
+
+	return ret;
+}
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
#29 lore raw

PATCH 7/13 drm/xe: Invalidate existing VRAM mappings on wedge

In reply to Arvind Yadav

CPU mappings created before a device wedge may keep valid PTEs and continue accessing VRAM. Redirecting new faults to a dummy page does not protect these existing mappings.

Use SRCU to synchronize CPU faults with wedge handling. The wedge worker waits for in-flight faults and then invalidates all tracked VRAM mappings. Faults starting after the wedge use the BO's dummy page.

SRCU allows the fault path to sleep during TTM fault handling. Notify userspace only after the existing mappings have been invalidated.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_bo.c           | 30 +++++++++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_bo.h           |  1 +
 drivers/gpu/drm/xe/xe_device.c       |  3 +++
 drivers/gpu/drm/xe/xe_device_types.h |  7 +++++++
 drivers/gpu/drm/xe/xe_pm.c           | 17 ++++++++++++++++
 5 files changed, 57 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_bo.c +29 -1
index 1f6ea9f5afe6..1eabece56f6c 100644
@@ -2140,9 +2140,14 @@ static vm_fault_t xe_bo_cpu_fault(struct vm_fault *vmf)
 	vm_fault_t ret;
 	int err = 0;
 	int idx;
+	int srcu_idx;
 
-	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx))
+	srcu_idx = srcu_read_lock(&xe->mem_access.vram_userfault.srcu);
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx)) {
+		srcu_read_unlock(&xe->mem_access.vram_userfault.srcu,
+				 srcu_idx);
 		return xe_bo_vm_dummy_page(vmf, bo);
+	}
 
 	ret = xe_bo_cpu_fault_fastpath(vmf, xe, bo, needs_rpm);
 	if (ret != VM_FAULT_RETRY)
@@ -2229,6 +2234,7 @@ static vm_fault_t xe_bo_cpu_fault(struct vm_fault *vmf)
 		xe_bo_put(bo);
 out:
 	drm_dev_exit(idx);
+	srcu_read_unlock(&xe->mem_access.vram_userfault.srcu, srcu_idx);
 
 	return ret;
 }
@@ -4136,6 +4142,28 @@ void xe_bo_runtime_pm_release_mmap_offset(struct xe_bo *bo)
 	list_del_init(&bo->vram_userfault_link);
 }
 
+/**
+ * xe_bo_wedged_invalidate_mmaps - Invalidate CPU mappings backed by VRAM
+ * @xe: xe device instance
+ *
+ * Wait for faults which may have observed the device before it was wedged,
+ * then remove all tracked VRAM mappings. Faults which start after the wedge
+ * map the per-BO dummy page and do not join the tracking list.
+ */
+void xe_bo_wedged_invalidate_mmaps(struct xe_device *xe)
+{
+	struct xe_bo *bo, *next;
+
+	synchronize_srcu(&xe->mem_access.vram_userfault.srcu);
+
+	mutex_lock(&xe->mem_access.vram_userfault.lock);
+	list_for_each_entry_safe(bo, next,
+				 &xe->mem_access.vram_userfault.list,
+				 vram_userfault_link)
+		xe_bo_runtime_pm_release_mmap_offset(bo);
+	mutex_unlock(&xe->mem_access.vram_userfault.lock);
+}
+
 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
 #include "tests/xe_bo.c"
 #endif
drivers/gpu/drm/xe/xe_bo.h +1 -0
index e8081af5bfc1..071870ec8289 100644
@@ -450,6 +450,7 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
 int xe_gem_mmap_offset_ioctl(struct drm_device *dev, void *data,
 			     struct drm_file *file);
 void xe_bo_runtime_pm_release_mmap_offset(struct xe_bo *bo);
+void xe_bo_wedged_invalidate_mmaps(struct xe_device *xe);
 
 int xe_bo_dumb_create(struct drm_file *file_priv,
 		      struct drm_device *dev,
drivers/gpu/drm/xe/xe_device.c +3 -0
index ffbaf85eaab1..98ef5123c841 100644
@@ -964,6 +964,9 @@ static void xe_device_wedged_work(struct work_struct *work)
 			container_of(work, struct xe_device, wedged.work);
 	unsigned long method;
 
+	/* Drain faults and invalidate existing VRAM mappings. */
+	xe_bo_wedged_invalidate_mmaps(xe);
+
 	/* Report at most one recovery method per worker invocation. */
 	method = READ_ONCE(xe->wedged.method);
 	if (method != READ_ONCE(xe->wedged.reported_method)) {
drivers/gpu/drm/xe/xe_device_types.h +7 -0
index 382a2b470647..43a86564adf0 100644
@@ -7,6 +7,7 @@
 #define _XE_DEVICE_TYPES_H_
 
 #include <linux/pci.h>
+#include <linux/srcu.h>
 
 #include <drm/drm_device.h>
 #include <drm/drm_file.h>
@@ -391,6 +392,12 @@ struct xe_device {
 		 * related stuff
 		 */
 		struct {
+			/**
+			 * @mem_access.vram_userfault.srcu: Serializes CPU faults
+			 * against wedge-time mapping invalidation
+			 */
+			struct srcu_struct srcu;
+
 			/**
 			 * @mem_access.vram_userfault.lock: Protects access to
 			 * @mem_access.vram_userfault.list Using mutex instead of spinlock
drivers/gpu/drm/xe/xe_pm.c +17 -0
index f517bf453b54..720e083cd279 100644
@@ -350,6 +350,13 @@ static void xe_pm_runtime_init(struct xe_device *xe)
 	pm_runtime_put(dev);
 }
 
+static void xe_vram_userfault_srcu_fini(struct drm_device *drm, void *arg)
+{
+	struct srcu_struct *srcu = arg;
+
+	cleanup_srcu_struct(srcu);
+}
+
 /**
  * xe_pm_init_early() - Initialize Xe Power Management
  * @xe: the &xe_device instance
@@ -372,6 +379,16 @@ int xe_pm_init_early(struct xe_device *xe)
 	if (err)
 		return err;
 
+	err = init_srcu_struct(&xe->mem_access.vram_userfault.srcu);
+	if (err)
+		return err;
+
+	err = drmm_add_action_or_reset(&xe->drm,
+				       xe_vram_userfault_srcu_fini,
+				       &xe->mem_access.vram_userfault.srcu);
+	if (err)
+		return err;
+
 	err = drmm_mutex_init(&xe->drm, &xe->d3cold.lock);
 	if (err)
 		return err;
Signature · 1 line
2.43.0
#30 lore raw

PATCH 8/13 drm/xe/irq: Serialize IRQ suspend and resume

In reply to Arvind Yadav

Wedge isolation suspends interrupts from a worker. This can race with PM resume and allow resume to enable interrupts after isolation has disabled them.

Add a managed mutex around IRQ suspend and resume. Check the wedged state while holding the mutex so either ordering leaves interrupts disabled.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_device_types.h |  4 ++++
 drivers/gpu/drm/xe/xe_irq.c          | 26 +++++++++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_device_types.h +4 -0
index 43a86564adf0..dda4d9919ca6 100644
@@ -6,6 +6,7 @@
 #ifndef _XE_DEVICE_TYPES_H_
 #define _XE_DEVICE_TYPES_H_
 
+#include <linux/mutex.h>
 #include <linux/pci.h>
 #include <linux/srcu.h>
 
@@ -266,6 +267,9 @@ struct xe_device {
 		/** @irq.lock: lock for processing irq's on this device */
 		spinlock_t lock;
 
+		/** @irq.pm_lock: Serializes IRQ suspend and resume */
+		struct mutex pm_lock;
+
 		/** @irq.enabled: interrupts enabled on this device */
 		atomic_t enabled;
 
drivers/gpu/drm/xe/xe_irq.c +23 -3
index d314993b14a1..9cdcb16f3ca8 100644
@@ -797,8 +797,14 @@ static void irq_uninstall(void *arg)
 
 int xe_irq_init(struct xe_device *xe)
 {
+	int err;
+
 	spin_lock_init(&xe->irq.lock);
 
+	err = drmm_mutex_init(&xe->drm, &xe->irq.pm_lock);
+	if (err)
+		return err;
+
 	return xe_irq_msix_init(xe);
 }
 
@@ -843,6 +849,8 @@ static void xe_irq_msi_synchronize_irq(struct xe_device *xe)
 
 void xe_irq_suspend(struct xe_device *xe)
 {
+	mutex_lock(&xe->irq.pm_lock);
+
 	atomic_set(&xe->irq.enabled, 0); /* no new irqs */
 
 	/* flush irqs */
@@ -851,6 +859,8 @@ void xe_irq_suspend(struct xe_device *xe)
 	else
 		xe_irq_msi_synchronize_irq(xe);
 	xe_irq_reset(xe); /* turn irqs off */
+
+	mutex_unlock(&xe->irq.pm_lock);
 }
 
 void xe_irq_resume(struct xe_device *xe)
@@ -858,10 +868,17 @@ void xe_irq_resume(struct xe_device *xe)
 	struct xe_gt *gt;
 	int id;
 
+	mutex_lock(&xe->irq.pm_lock);
+
+	if (xe_device_wedged(xe))
+		goto out_unlock;
+
 	/*
-	 * lock not needed:
-	 * 1. no irq will arrive before the postinstall
-	 * 2. display is not yet resumed
+	 * pm_lock serializes resume against wedge isolation.
+	 *
+	 * irq.lock is not needed because:
+	 * 1. no IRQ arrives before postinstall;
+	 * 2. display has not been resumed yet.
 	 */
 	atomic_set(&xe->irq.enabled, 1);
 	xe_irq_reset(xe);
@@ -869,6 +886,9 @@ void xe_irq_resume(struct xe_device *xe)
 
 	for_each_gt(gt, xe, id)
 		xe_irq_enable_hwe(gt);
+
+out_unlock:
+	mutex_unlock(&xe->irq.pm_lock);
 }
 
 /* MSI-X related definitions and functions below. */
Signature · 1 line
2.43.0
maintainer
#31 lore raw

Re: [PATCH 08/13] drm/xe/irq: Serialize IRQ suspend and resume

Quoted 81 lines · Arvind Yadav

Wedge isolation suspends interrupts from a worker. This can race with PM resume and allow resume to enable interrupts after isolation has disabled them.

Add a managed mutex around IRQ suspend and resume. Check the wedged state while holding the mutex so either ordering leaves interrupts disabled.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_device_types.h |  4 ++++
 drivers/gpu/drm/xe/xe_irq.c          | 26 +++++++++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_device_types.h +4 -0
index 43a86564adf0..dda4d9919ca6 100644
@@ -6,6 +6,7 @@
 #ifndef _XE_DEVICE_TYPES_H_
 #define _XE_DEVICE_TYPES_H_
 
+#include <linux/mutex.h>
 #include <linux/pci.h>
 #include <linux/srcu.h>
 
@@ -266,6 +267,9 @@ struct xe_device {
 		/** @irq.lock: lock for processing irq's on this device */
 		spinlock_t lock;
 
+		/** @irq.pm_lock: Serializes IRQ suspend and resume */
+		struct mutex pm_lock;
+
 		/** @irq.enabled: interrupts enabled on this device */
 		atomic_t enabled;
 
drivers/gpu/drm/xe/xe_irq.c +10 -0
index d314993b14a1..9cdcb16f3ca8 100644
@@ -797,8 +797,14 @@ static void irq_uninstall(void *arg)
 
 int xe_irq_init(struct xe_device *xe)
 {
+	int err;
+
 	spin_lock_init(&xe->irq.lock);
 
+	err = drmm_mutex_init(&xe->drm, &xe->irq.pm_lock);
+	if (err)
+		return err;
+
 	return xe_irq_msix_init(xe);
 }
 
@@ -843,6 +849,8 @@ static void xe_irq_msi_synchronize_irq(struct xe_device *xe)
 
 void xe_irq_suspend(struct xe_device *xe)
 {
+	mutex_lock(&xe->irq.pm_lock);
+
 	atomic_set(&xe->irq.enabled, 0); /* no new irqs */
 
 	/* flush irqs */
@@ -851,6 +859,8 @@ void xe_irq_suspend(struct xe_device *xe)
 	else
 		xe_irq_msi_synchronize_irq(xe);
 	xe_irq_reset(xe); /* turn irqs off */
+
+	mutex_unlock(&xe->irq.pm_lock);
 }
 
 void xe_irq_resume(struct xe_device *xe)
@@ -858,10 +868,17 @@ void xe_irq_resume(struct xe_device *xe)
 	struct xe_gt *gt;
 	int id;
 

drivers/gpu/drm/xe/xe_irq.c void xe_irq_resume(struct xe_device *xe) · line 877

Quoted 10 lines
drivers/gpu/drm/xe/xe_irq.c +6 -3
+	mutex_lock(&xe->irq.pm_lock);
+
+	if (xe_device_wedged(xe))
+		goto out_unlock;
+
 	/*
-	 * lock not needed:
-	 * 1. no irq will arrive before the postinstall
-	 * 2. display is not yet resumed
+	 * pm_lock serializes resume against wedge isolation.

if we are using mutex to serialize code we are doing it wrong. worth reading: https://blog.ffwll.ch/2022/08/locking-hierarchy.html

Quoted 20 lines
drivers/gpu/drm/xe/xe_irq.c +7 -0
+	 *
+	 * irq.lock is not needed because:
+	 * 1. no IRQ arrives before postinstall;
+	 * 2. display has not been resumed yet.
 	 */
 	atomic_set(&xe->irq.enabled, 1);
 	xe_irq_reset(xe);
@@ -869,6 +886,9 @@ void xe_irq_resume(struct xe_device *xe)
 
 	for_each_gt(gt, xe, id)
 		xe_irq_enable_hwe(gt);
+
+out_unlock:
+	mutex_unlock(&xe->irq.pm_lock);
 }
 
 /* MSI-X related definitions and functions below. */
Signature · 1 line
2.43.0
#32 lore raw

Re: [PATCH 08/13] drm/xe/irq: Serialize IRQ suspend and resume

Quoted 82 lines · Rodrigo Vivi
Quoted 81 lines · Arvind Yadav

Wedge isolation suspends interrupts from a worker. This can race with PM resume and allow resume to enable interrupts after isolation has disabled them.

Add a managed mutex around IRQ suspend and resume. Check the wedged state while holding the mutex so either ordering leaves interrupts disabled.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_device_types.h |  4 ++++
  drivers/gpu/drm/xe/xe_irq.c          | 26 +++++++++++++++++++++++---
  2 files changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_device_types.h +4 -0
index 43a86564adf0..dda4d9919ca6 100644
@@ -6,6 +6,7 @@
  #ifndef _XE_DEVICE_TYPES_H_
  #define _XE_DEVICE_TYPES_H_
 
+#include <linux/mutex.h>
  #include <linux/pci.h>
  #include <linux/srcu.h>
 
@@ -266,6 +267,9 @@ struct xe_device {
  		/** @irq.lock: lock for processing irq's on this device */
  		spinlock_t lock;
 
+		/** @irq.pm_lock: Serializes IRQ suspend and resume */
+		struct mutex pm_lock;
+
  		/** @irq.enabled: interrupts enabled on this device */
  		atomic_t enabled;
 
drivers/gpu/drm/xe/xe_irq.c +10 -0
index d314993b14a1..9cdcb16f3ca8 100644
@@ -797,8 +797,14 @@ static void irq_uninstall(void *arg)
 
  int xe_irq_init(struct xe_device *xe)
  {
+	int err;
+
  	spin_lock_init(&xe->irq.lock);
 
+	err = drmm_mutex_init(&xe->drm, &xe->irq.pm_lock);
+	if (err)
+		return err;
+
  	return xe_irq_msix_init(xe);
  }
 
@@ -843,6 +849,8 @@ static void xe_irq_msi_synchronize_irq(struct xe_device *xe)
 
  void xe_irq_suspend(struct xe_device *xe)
  {
+	mutex_lock(&xe->irq.pm_lock);
+
  	atomic_set(&xe->irq.enabled, 0); /* no new irqs */
 
  	/* flush irqs */
@@ -851,6 +859,8 @@ void xe_irq_suspend(struct xe_device *xe)
  	else
  		xe_irq_msi_synchronize_irq(xe);
  	xe_irq_reset(xe); /* turn irqs off */
+
+	mutex_unlock(&xe->irq.pm_lock);
  }
 
  void xe_irq_resume(struct xe_device *xe)
@@ -858,10 +868,17 @@ void xe_irq_resume(struct xe_device *xe)
  	struct xe_gt *gt;
  	int id;
 
Quoted 12 lines

drivers/gpu/drm/xe/xe_irq.c void xe_irq_resume(struct xe_device *xe) · line 877

Quoted 10 lines
drivers/gpu/drm/xe/xe_irq.c +6 -3
+	mutex_lock(&xe->irq.pm_lock);
+
+	if (xe_device_wedged(xe))
+		goto out_unlock;
+
  	/*
-	 * lock not needed:
-	 * 1. no irq will arrive before the postinstall
-	 * 2. display is not yet resumed
+	 * pm_lock serializes resume against wedge isolation.

if we are using mutex to serialize code we are doing it wrong. worth reading: https://blog.ffwll.ch/2022/08/locking-hierarchy.html

Thanks for pointing this out.  The mutex protects the state around irq.enabled, not the suspend/resume functions.
I guess the current mutex name and commit message do not make this clear. So I will  rename it to state_lock and update the comments and commit message to make this clearer.

Thanks,
Arvind

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/xe/xe_irq.c +7 -0
+	 *
+	 * irq.lock is not needed because:
+	 * 1. no IRQ arrives before postinstall;
+	 * 2. display has not been resumed yet.
  	 */
  	atomic_set(&xe->irq.enabled, 1);
  	xe_irq_reset(xe);
@@ -869,6 +886,9 @@ void xe_irq_resume(struct xe_device *xe)
 
  	for_each_gt(gt, xe, id)
  		xe_irq_enable_hwe(gt);
+
+out_unlock:
+	mutex_unlock(&xe->irq.pm_lock);
  }
 
  /* MSI-X related definitions and functions below. */
Signature · 1 line
2.43.0
#33 lore raw

PATCH 9/13 drm/xe: Isolate a wedged device before notifying userspace

In reply to Arvind Yadav

A permanently wedged device must stop interrupt and DMA activity before userspace is notified that recovery is required.

Run the sleepable isolation steps from the wedge worker. Shut down and unregister the display, invalidate VRAM mappings, suspend interrupts and clear PCI bus mastering before sending the event. GTs are declared wedged before the work is queued, so pending fences are signalled before the worker waits for fault-side SRCU readers.

Track display and isolation state so later teardown does not repeat these steps. Display shutdown already disables display power, so skip the runtime PM disable when unregister follows shutdown.

System suspend may see the wedge flag before the worker is queued. Use a completion to close this window and flush the worker before skipping normal device suspend. The IRQ serialization keeps a racing resume from enabling interrupts after isolation.

For a wedged device, resume restores PCI configuration and clears bus mastering. Do not call pci_enable_device() because suspend did not take the matching disable reference.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/display/xe_display.c | 18 +++++++++---
 drivers/gpu/drm/xe/xe_device.c          | 38 +++++++++++++++++++++++--
 drivers/gpu/drm/xe/xe_device_types.h    |  9 ++++++
 drivers/gpu/drm/xe/xe_pci.c             | 23 ++++++++++++++-
 4 files changed, 81 insertions(+), 7 deletions(-)
drivers/gpu/drm/xe/display/xe_display.c +14 -4
index 7b25c0814674..ce9ebc6701ff 100644
@@ -150,21 +150,28 @@ void xe_display_register(struct xe_device *xe)
 {
 	struct intel_display *display = xe->display;
 
-	if (!xe->info.probe_display)
+	if (!xe->info.probe_display || xe->display_registered)
 		return;
 
 	intel_display_driver_register(display);
 	intel_display_driver_runtime_pm_enable(display);
+
+	xe->display_registered = true;
 }
 
 void xe_display_unregister(struct xe_device *xe)
 {
 	struct intel_display *display = xe->display;
 
-	if (!xe->info.probe_display)
+	if (!xe->info.probe_display || !xe->display_registered)
 		return;
 
-	intel_display_driver_runtime_pm_disable(display);
+	/* Make display unregister idempotent. */
+	xe->display_registered = false;
+
+	if (!xe->display_shutdown)
+		intel_display_driver_runtime_pm_disable(display);
+
 	intel_display_driver_unregister(display);
 }
 
@@ -172,7 +179,8 @@ void xe_display_shutdown(struct xe_device *xe)
 {
 	struct intel_display *display = xe->display;
 
-	if (!xe->info.probe_display)
+	if (!xe->info.probe_display || !xe->display_registered ||
+	    xe->display_shutdown)
 		return;
 
 	intel_display_driver_shutdown(display);
@@ -180,6 +188,8 @@ void xe_display_shutdown(struct xe_device *xe)
 	intel_opregion_suspend(display, PCI_D3cold);
 
 	intel_dmc_suspend(display);
+
+	xe->display_shutdown = true;
 }
 
 void xe_display_shutdown_late(struct xe_device *xe)
drivers/gpu/drm/xe/xe_device.c +36 -2
index 98ef5123c841..101cfa8e2102 100644
@@ -538,6 +538,7 @@ int xe_device_init_early(struct xe_device *xe)
 	int err;
 
 	INIT_WORK(&xe->wedged.work, xe_device_wedged_work);
+	init_completion(&xe->wedged.prepared);
 	xe->wedged.reported_method = ~0UL;
 
 	err = ttm_device_init(&xe->ttm, &xe_ttm_funcs, xe->drm.dev,
@@ -958,14 +959,44 @@ static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
 }
 #endif
 
+/*
+ * Isolate a permanently wedged device.
+ *
+ * May sleep and must be called from process context.
+ */
+static void xe_device_wedged_isolate(struct xe_device *xe)
+{
+	/*
+	 * Wait until xe_device_declare_wedged() has finished scanning GT
+	 * submission state before isolating the device.
+	 */
+	wait_for_completion(&xe->wedged.prepared);
+
+	if (!xe->wedged.isolated) {
+		xe_display_shutdown(xe);
+		xe_display_unregister(xe);
+
+		/*
+		 * Drain faults and unmap VRAM before disabling IRQs and
+		 * DMA.
+		 */
+		xe_bo_wedged_invalidate_mmaps(xe);
+
+		/* Drain handlers before preventing any further device DMA. */
+		xe_irq_suspend(xe);
+		pci_clear_master(to_pci_dev(xe->drm.dev));
+
+		xe->wedged.isolated = true;
+	}
+}
+
 static void xe_device_wedged_work(struct work_struct *work)
 {
 	struct xe_device *xe =
 			container_of(work, struct xe_device, wedged.work);
 	unsigned long method;
 
-	/* Drain faults and invalidate existing VRAM mappings. */
-	xe_bo_wedged_invalidate_mmaps(xe);
+	xe_device_wedged_isolate(xe);
 
 	/* Report at most one recovery method per worker invocation. */
 	method = READ_ONCE(xe->wedged.method);
@@ -1556,6 +1587,9 @@ void xe_device_declare_wedged(struct xe_device *xe)
 	    READ_ONCE(xe->wedged.method) !=
 	    READ_ONCE(xe->wedged.reported_method))
 		queue_work(xe->unordered_wq, &xe->wedged.work);
+
+	if (first)
+		complete_all(&xe->wedged.prepared);
 }
 
 /**
drivers/gpu/drm/xe/xe_device_types.h +9 -0
index dda4d9919ca6..508ba3872e72 100644
@@ -6,6 +6,7 @@
 #ifndef _XE_DEVICE_TYPES_H_
 #define _XE_DEVICE_TYPES_H_
 
+#include <linux/completion.h>
 #include <linux/mutex.h>
 #include <linux/pci.h>
 #include <linux/srcu.h>
@@ -113,6 +114,10 @@ struct xe_device {
 #if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
 	/** @display: display device data, must be placed after drm device member */
 	struct intel_display *display;
+	/** @display_registered: Display userspace interfaces are registered */
+	bool display_registered;
+	/** @display_shutdown: Display hardware shutdown has completed */
+	bool display_shutdown;
 #endif
 
 	/** @devcoredump: device coredump */
@@ -547,8 +552,12 @@ struct xe_device {
 		bool inconsistent_reset;
 		/** @wedged.work: Runs sleepable wedge handling */
 		struct work_struct work;
+		/** @wedged.prepared: First wedge declaration finished and work was queued */
+		struct completion prepared;
 		/** @wedged.reported_method: Last recovery method reported to userspace */
 		unsigned long reported_method;
+		/** @wedged.isolated: Terminal device isolation has completed */
+		bool isolated;
 	} wedged;
 
 	/** @devres_group: devres group */
drivers/gpu/drm/xe/xe_pci.c +22 -1
index ab4da1d9a9f1..aaeb7d068175 100644
@@ -1332,6 +1332,16 @@ static int xe_pci_suspend(struct device *dev)
 	if (xe_survivability_mode_is_boot_enabled(xe))
 		return -EBUSY;
 
+	/*
+	 * Wait until wedge work is queued, then wait for isolation to
+	 * finish before skipping normal suspend.
+	 */
+	if (xe_device_wedged(xe)) {
+		wait_for_completion(&xe->wedged.prepared);
+		flush_work(&xe->wedged.work);
+		return 0;
+	}
+
 	err = xe_pm_suspend(xe);
 	if (err)
 		return err;
@@ -1353,6 +1363,7 @@ static int xe_pci_suspend(struct device *dev)
 static int xe_pci_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct xe_device *xe = pdev_to_xe_device(pdev);
 	int err;
 
 	/* Give back the D3Cold decision to the runtime P M*/
@@ -1364,13 +1375,23 @@ static int xe_pci_resume(struct device *dev)
 
 	pci_restore_state(pdev);
 
+	/*
+	 * Suspend skipped PCI disable for an already isolated device. Avoid
+	 * incrementing enable_cnt and clear bus mastering restored from the
+	 * saved configuration.
+	 */
+	if (xe_device_wedged(xe)) {
+		pci_clear_master(pdev);
+		return 0;
+	}
+
 	err = pci_enable_device(pdev);
 	if (err)
 		return err;
 
 	pci_set_master(pdev);
 
-	err = xe_pm_resume(pdev_to_xe_device(pdev));
+	err = xe_pm_resume(xe);
 	if (err)
 		return err;
 
Signature · 1 line
2.43.0
#34 lore raw

Re: [PATCH 09/13] drm/xe: Isolate a wedged device before notifying userspace

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] TOCTOU race in `xe_pci_suspend` allows concurrent execution of `xe_pm_suspend` and the…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] TOCTOU race in xe_pci_suspend allows concurrent execution of xe_pm_suspend and the asynchronous wedge worker, leading to unbalanced PCI enable counts and unsafe MMIO accesses.
- [High] The xe_pci_resume function unconditionally toggles D3Cold, leading to unbalanced power state changes when the device is wedged.
--

commit fc050bbcfed735c33773bd7fb0bbf0a5e4fe47a1
Author: Arvind Yadav <[email protected]>

drm/xe: Isolate a wedged device before notifying userspace

This commit introduces a sleepable wedge worker to safely isolate a permanently wedged device. It stops interrupt and DMA activity, invalidates VRAM mappings, and updates the suspend and resume paths to wait for device isolation and skip normal PM transitions when the device is wedged.

Quoted 8 lines
drivers/gpu/drm/xe/xe_pci.c +0 -0
index 1e04e8ef2611f..beaa79d136198 100644
@@ -1331,6 +1331,16 @@ static int xe_pci_suspend(struct device *dev)
 	if (xe_survivability_mode_is_boot_enabled(xe))
 		return -EBUSY;
 

drivers/gpu/drm/xe/xe_pci.c static int xe_pci_suspend(struct device *dev) · line 1343

Quoted 10 lines
drivers/gpu/drm/xe/xe_pci.c +10 -0
+	/*
+	 * Wait until wedge work is queued, then wait for isolation to
+	 * finish before skipping normal suspend.
+	 */
+	if (xe_device_wedged(xe)) {
+		wait_for_completion(&xe->wedged.prepared);
+		flush_work(&xe->wedged.work);
+		return 0;
+	}
+

[Severity: High]
Does this lockless check open a TOCTOU race window before proceeding to the normal PM suspend flow and pci_disable_device()?

If the device is declared wedged immediately after the lockless xe_device_wedged(xe) check evaluates to false, xe_pci_suspend() will proceed with executing xe_pm_suspend() and eventually calling pci_disable_device(pdev). Meanwhile, xe_device_wedged_work() executes concurrently with xe_pm_suspend().

Later during system resume, xe_pci_resume() will see xe_device_wedged(xe) as true and return early without calling pci_enable_device(pdev). This results in an unbalanced pci_disable_device() leaving enable_cnt decremented without a matching increment.

Could this happen if a hardware timeout occurs during the suspend process itself (e.g., during GT suspend or eviction timeout)?

Also, if the device is already wedged and xe_pci_suspend() returns 0 here, it skips the d3cold_toggle(pdev, D3COLD_ENABLE) call which occurs later in this function.

[ ... ]

Quoted 14 lines
drivers/gpu/drm/xe/xe_pci.c +1 -0
@@ -1352,6 +1362,7 @@ static int xe_pci_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct xe_device *xe = pdev_to_xe_device(pdev);
 	int err;
 
 	/* Give back the D3Cold decision to the runtime P M*/
 	d3cold_toggle(pdev, D3COLD_DISABLE);
drivers/gpu/drm/xe/xe_pci.c +0 -0
 	err = pci_set_power_state(pdev, PCI_D0);
 	if (err)
 		return err;
 
 	pci_restore_state(pdev);

drivers/gpu/drm/xe/xe_pci.c static int xe_pci_resume(struct device *dev) · line 1386

Quoted 10 lines
drivers/gpu/drm/xe/xe_pci.c +9 -0
 
+	/*
+	 * Suspend skipped PCI disable for an already isolated device. Avoid
+	 * incrementing enable_cnt and clear bus mastering restored from the
+	 * saved configuration.
+	 */
+	if (xe_device_wedged(xe)) {
+		pci_clear_master(pdev);
+		return 0;
+	}

[Severity: High]
Does this unconditionally toggle D3Cold before checking if the device is wedged?

If the device is wedged before xe_pci_suspend() is called, it returns early and skips the balancing d3cold_toggle(pdev, D3COLD_ENABLE) call. However, on system resume, xe_pci_resume() unconditionally calls d3cold_toggle(pdev, D3COLD_DISABLE) before checking if the device is wedged.

Can this lead to an unbalanced call to pci_d3cold_disable(root_pdev) (which increments no_d3cold) on every suspend/resume cycle once the device has been permanently wedged, eventually breaking D3Cold power management for the root port?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
#35 lore raw

PATCH 10/13 drm/xe/ttm: Reject VRAM allocations on wedged devices

In reply to Arvind Yadav

VRAM is no longer usable after the device is wedged. Reject new VRAM allocations with -ENOSPC so TTM can try another placement, such as TT.

An allocation racing with the wedge may still complete. The wedged fault path prevents new VRAM CPU mappings, and device teardown releases the resource.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +4 -0
index 05911904c1f9..d0b266672010 100644
@@ -54,6 +54,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
 			       const struct ttm_place *place,
 			       struct ttm_resource **res)
 {
+	struct xe_device *xe = ttm_to_xe_device(tbo->bdev);
 	struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man);
 	struct xe_ttm_vram_mgr_resource *vres;
 	struct gpu_buddy *mm = &mgr->mm;
@@ -61,6 +62,9 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
 	unsigned long lpfn;
 	int err;
 
+	if (xe_device_wedged(xe))
+		return -ENOSPC;
+
 	lpfn = place->lpfn;
 	if (!lpfn || lpfn > man->size >> PAGE_SHIFT)
 		lpfn = man->size >> PAGE_SHIFT;
Signature · 1 line
2.43.0
maintainer
#36 lore raw

Re: [PATCH 10/13] drm/xe/ttm: Reject VRAM allocations on wedged devices

Quoted 30 lines · Arvind Yadav

VRAM is no longer usable after the device is wedged. Reject new VRAM allocations with -ENOSPC so TTM can try another placement, such as TT.

An allocation racing with the wedge may still complete. The wedged fault path prevents new VRAM CPU mappings, and device teardown releases the resource.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +1 -0
index 05911904c1f9..d0b266672010 100644
@@ -54,6 +54,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
 			       const struct ttm_place *place,
 			       struct ttm_resource **res)
 {
+	struct xe_device *xe = ttm_to_xe_device(tbo->bdev);
 	struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man);
 	struct xe_ttm_vram_mgr_resource *vres;
 	struct gpu_buddy *mm = &mgr->mm;

drivers/gpu/drm/xe/xe_ttm_vram_mgr.c static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, · line 66

Quoted 5 lines
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +2 -0
@@ -61,6 +62,9 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
 	unsigned long lpfn;
 	int err;
 
+	if (xe_device_wedged(xe))
+		return -ENOSPC;

is -ENOSPC the right return here? -EIO? -ENOENT? -ENODEV? -ENXIO? -EPIPE?

Quoted 7 lines
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +1 -0
+
 	lpfn = place->lpfn;
 	if (!lpfn || lpfn > man->size >> PAGE_SHIFT)
 		lpfn = man->size >> PAGE_SHIFT;
Signature · 1 line
2.43.0
#37 lore raw

Re: [PATCH 10/13] drm/xe/ttm: Reject VRAM allocations on wedged devices

Quoted 34 lines · Rodrigo Vivi
Quoted 33 lines · Arvind Yadav

VRAM is no longer usable after the device is wedged. Reject new VRAM allocations with -ENOSPC so TTM can try another placement, such as TT.

An allocation racing with the wedge may still complete. The wedged fault path prevents new VRAM CPU mappings, and device teardown releases the resource.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +1 -0
index 05911904c1f9..d0b266672010 100644
@@ -54,6 +54,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
  			       const struct ttm_place *place,
  			       struct ttm_resource **res)
  {
+	struct xe_device *xe = ttm_to_xe_device(tbo->bdev);
  	struct xe_ttm_vram_mgr *mgr = to_xe_ttm_vram_mgr(man);
  	struct xe_ttm_vram_mgr_resource *vres;
  	struct gpu_buddy *mm = &mgr->mm;
@@ -61,6 +62,9 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
  	unsigned long lpfn;
  	int err;
 
Quoted 3 lines

drivers/gpu/drm/xe/xe_ttm_vram_mgr.c static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man, · line 66

Quoted 2 lines
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +2 -0
+	if (xe_device_wedged(xe))
+		return -ENOSPC;

is -ENOSPC the right return here? -EIO? -ENOENT? -ENODEV? -ENXIO? -EPIPE?

Thanks for the review.
I used -ENOSPC so TTM could try another placement such as TT.
I guess there is no need to try another placement after a permanent wedge because the device cannot process new work.

I will change it to -ENODEV so TTM returns a terminal error.

Thanks,
Arvind

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c +1 -0
+
  	lpfn = place->lpfn;
  	if (!lpfn || lpfn > man->size >> PAGE_SHIFT)
  		lpfn = man->size >> PAGE_SHIFT;
Signature · 1 line
2.43.0
#38 lore raw

PATCH 11/13 drm/xe/guc: Skip timeout recovery on a wedged device

In reply to Arvind Yadav

A scheduler timeout can still run after the device has been declared wedged. guc_submit_hint_wedged() only returns true for the no-reset debug mode, so other wedge modes can continue into GuC timeout recovery.

The killed-queue case already preserves an existing wedge. Extend the same check to non-killed queues, where guc_submit_hint_wedged() returns false outside the no-reset debug mode.

If the device is already wedged, use the existing wedged cleanup path and avoid further hardware recovery. This also avoids the kernel-submitted job timeout warning seen after wedge isolation.

The timeout was observed as:

[ 8939.200065] xe 0000:03:00.0: [drm] Tile0: GT0: Kernel-submitted job timed out
[ 8939.200066] WARNING: xe_guc_submit.c:1683 at guc_exec_queue_timedout_job+0x1160/0x2550
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_guc_submit.c +2 -3
index a307af458cf8..287a30027b1c 100644
@@ -1594,10 +1594,9 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	 * Killed queues must not newly wedge the device, but preserve an
 	 * already-wedged state to avoid warning on teardown timeouts.
 	 */
-	if (!exec_queue_killed(q))
+	wedged = xe_device_wedged(xe);
+	if (!wedged && !exec_queue_killed(q))
 		wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
-	else
-		wedged = xe_device_wedged(xe);
 
 	set_exec_queue_banned(q);
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 11/13
#39 lore raw

Re: [PATCH 11/13] drm/xe/guc: Skip timeout recovery on a wedged device

Quoted 16 lines · Arvind Yadav

A scheduler timeout can still run after the device has been declared wedged. guc_submit_hint_wedged() only returns true for the no-reset debug mode, so other wedge modes can continue into GuC timeout recovery.

The killed-queue case already preserves an existing wedge. Extend the same check to non-killed queues, where guc_submit_hint_wedged() returns false outside the no-reset debug mode.

If the device is already wedged, use the existing wedged cleanup path and avoid further hardware recovery. This also avoids the kernel-submitted job timeout warning seen after wedge isolation.

The timeout was observed as:

[ 8939.200065] xe 0000:03:00.0: [drm] Tile0: GT0: Kernel-submitted job timed out
[ 8939.200066] WARNING: xe_guc_submit.c:1683 at guc_exec_queue_timedout_job+0x1160/0x2550
Quoted 6 lines
Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
Quoted 24 lines
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/xe/xe_guc_submit.c +2 -3
index a307af458cf8..287a30027b1c 100644
@@ -1594,10 +1594,9 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	 * Killed queues must not newly wedge the device, but preserve an
 	 * already-wedged state to avoid warning on teardown timeouts.
 	 */
-	if (!exec_queue_killed(q))
+	wedged = xe_device_wedged(xe);
+	if (!wedged && !exec_queue_killed(q))
 		wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
-	else
-		wedged = xe_device_wedged(xe);
 
 	set_exec_queue_banned(q);
 
Signature · 1 line
2.43.0
#40 lore raw

PATCH 12/13 drm/xe: Skip PM notifier preparation for wedged devices

In reply to Arvind Yadav

The system PM notifier runs before the PCI suspend callback and may evict BOs or submit migration work. This work must not start after the device has been declared wedged.

Skip PM preparation for a wedged device. Track whether preparation ran so the post callback only performs matching cleanup and releases the runtime PM reference when needed.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_device_types.h |  2 ++
 drivers/gpu/drm/xe/xe_pm.c           | 10 ++++++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/xe/xe_device_types.h +2 -0
index 508ba3872e72..c9dc417878e7 100644
@@ -471,6 +471,8 @@ struct xe_device {
 
 	/** @pm_notifier: Our PM notifier to perform actions in response to various PM events. */
 	struct notifier_block pm_notifier;
+	/** @pm_notifier_active: PM notifier prepare work was performed */
+	bool pm_notifier_active;
 	/** @pm_block: Completion to block validating tasks on suspend / hibernate prepare */
 	struct completion pm_block;
 	/** @rebind_resume_list: List of wq items to kick on resume. */
drivers/gpu/drm/xe/xe_pm.c +10 -0
index 720e083cd279..dd7fd170bc94 100644
@@ -457,9 +457,14 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
 	{
 		struct xe_validation_ctx ctx;
 
+		/* Do not start PM preparation after a wedge is declared. */
+		if (xe_device_wedged(xe))
+			break;
+
 		reinit_completion(&xe->pm_block);
 		xe_pm_block_begin_signalling();
 		xe_pm_runtime_get(xe);
+		xe->pm_notifier_active = true;
 		(void)xe_validation_ctx_init(&ctx, &xe->val, NULL,
 					     (struct xe_val_flags) {.exclusive = true});
 		err = xe_bo_evict_all_user(xe);
@@ -480,6 +485,11 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
 	}
 	case PM_POST_HIBERNATION:
 	case PM_POST_SUSPEND:
+		if (!xe->pm_notifier_active)
+			break;
+
+		xe->pm_notifier_active = false;
+
 		complete_all(&xe->pm_block);
 		xe_pm_wake_rebind_workers(xe);
 		xe_bo_notifier_unprepare_all_pinned(xe);
Signature · 1 line
2.43.0
maintainer
#41 lore raw

Re: [PATCH 12/13] drm/xe: Skip PM notifier preparation for wedged devices

Quoted 37 lines · Arvind Yadav

The system PM notifier runs before the PCI suspend callback and may evict BOs or submit migration work. This work must not start after the device has been declared wedged.

Skip PM preparation for a wedged device. Track whether preparation ran so the post callback only performs matching cleanup and releases the runtime PM reference when needed.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_device_types.h |  2 ++
 drivers/gpu/drm/xe/xe_pm.c           | 10 ++++++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/xe/xe_device_types.h +2 -0
index 508ba3872e72..c9dc417878e7 100644
@@ -471,6 +471,8 @@ struct xe_device {
 
 	/** @pm_notifier: Our PM notifier to perform actions in response to various PM events. */
 	struct notifier_block pm_notifier;
+	/** @pm_notifier_active: PM notifier prepare work was performed */
+	bool pm_notifier_active;
 	/** @pm_block: Completion to block validating tasks on suspend / hibernate prepare */
 	struct completion pm_block;
 	/** @rebind_resume_list: List of wq items to kick on resume. */
drivers/gpu/drm/xe/xe_pm.c +0 -0
index 720e083cd279..dd7fd170bc94 100644

drivers/gpu/drm/xe/xe_pm.c static int xe_pm_notifier_callback(struct notifier_block *nb, · line 462

Quoted 6 lines
drivers/gpu/drm/xe/xe_pm.c +3 -0
@@ -457,9 +457,14 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
 	{
 		struct xe_validation_ctx ctx;
 
+		/* Do not start PM preparation after a wedge is declared. */
+		if (xe_device_wedged(xe))
+			break;

perhaps we need to return NOTIFY_BAD ?!

Quoted 23 lines
drivers/gpu/drm/xe/xe_pm.c +7 -0
+
 		reinit_completion(&xe->pm_block);
 		xe_pm_block_begin_signalling();
 		xe_pm_runtime_get(xe);
+		xe->pm_notifier_active = true;
 		(void)xe_validation_ctx_init(&ctx, &xe->val, NULL,
 					     (struct xe_val_flags) {.exclusive = true});
 		err = xe_bo_evict_all_user(xe);
@@ -480,6 +485,11 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
 	}
 	case PM_POST_HIBERNATION:
 	case PM_POST_SUSPEND:
+		if (!xe->pm_notifier_active)
+			break;
+
+		xe->pm_notifier_active = false;
+
 		complete_all(&xe->pm_block);
 		xe_pm_wake_rebind_workers(xe);
 		xe_bo_notifier_unprepare_all_pinned(xe);
Signature · 1 line
2.43.0
#42 lore raw

Re: [PATCH 12/13] drm/xe: Skip PM notifier preparation for wedged devices

Quoted 41 lines · Rodrigo Vivi
Quoted 40 lines · Arvind Yadav

The system PM notifier runs before the PCI suspend callback and may evict BOs or submit migration work. This work must not start after the device has been declared wedged.

Skip PM preparation for a wedged device. Track whether preparation ran so the post callback only performs matching cleanup and releases the runtime PM reference when needed.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_device_types.h |  2 ++
  drivers/gpu/drm/xe/xe_pm.c           | 10 ++++++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/xe/xe_device_types.h +2 -0
index 508ba3872e72..c9dc417878e7 100644
@@ -471,6 +471,8 @@ struct xe_device {
 
  	/** @pm_notifier: Our PM notifier to perform actions in response to various PM events. */
  	struct notifier_block pm_notifier;
+	/** @pm_notifier_active: PM notifier prepare work was performed */
+	bool pm_notifier_active;
  	/** @pm_block: Completion to block validating tasks on suspend / hibernate prepare */
  	struct completion pm_block;
  	/** @rebind_resume_list: List of wq items to kick on resume. */
drivers/gpu/drm/xe/xe_pm.c +0 -0
index 720e083cd279..dd7fd170bc94 100644
@@ -457,9 +457,14 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
  	{
  		struct xe_validation_ctx ctx;
 
Quoted 4 lines

drivers/gpu/drm/xe/xe_pm.c static int xe_pm_notifier_callback(struct notifier_block *nb, · line 462

Quoted 3 lines
drivers/gpu/drm/xe/xe_pm.c +3 -0
+		/* Do not start PM preparation after a wedge is declared. */
+		if (xe_device_wedged(xe))
+			break;

perhaps we need to return NOTIFY_BAD ?!

Thanks for the review.
I do not think NOTIFY_BAD is needed here. A permanently wedged device should not prevent system suspend. pm_notifier_call_chain_robust() passes the notifier result to notifier_to_errno(). NOTIFY_BAD becomes -EPERM, which will aborts system suspend.

~Arvind

Quoted 24 lines
Quoted 24 lines
drivers/gpu/drm/xe/xe_pm.c +7 -0
+
  		reinit_completion(&xe->pm_block);
  		xe_pm_block_begin_signalling();
  		xe_pm_runtime_get(xe);
+		xe->pm_notifier_active = true;
  		(void)xe_validation_ctx_init(&ctx, &xe->val, NULL,
  					     (struct xe_val_flags) {.exclusive = true});
  		err = xe_bo_evict_all_user(xe);
@@ -480,6 +485,11 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
  	}
  	case PM_POST_HIBERNATION:
  	case PM_POST_SUSPEND:
+		if (!xe->pm_notifier_active)
+			break;
+
+		xe->pm_notifier_active = false;
+
  		complete_all(&xe->pm_block);
  		xe_pm_wake_rebind_workers(xe);
  		xe_bo_notifier_unprepare_all_pinned(xe);
Signature · 1 line
2.43.0
maintainer
#43 lore raw

Re: [PATCH 12/13] drm/xe: Skip PM notifier preparation for wedged devices

Quoted 47 lines · Arvind
Quoted 35 lines · Rodrigo Vivi
Quoted 34 lines · Arvind Yadav

The system PM notifier runs before the PCI suspend callback and may evict BOs or submit migration work. This work must not start after the device has been declared wedged.

Skip PM preparation for a wedged device. Track whether preparation ran so the post callback only performs matching cleanup and releases the runtime PM reference when needed.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
  drivers/gpu/drm/xe/xe_device_types.h |  2 ++
  drivers/gpu/drm/xe/xe_pm.c           | 10 ++++++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/xe/xe_device_types.h +2 -0
index 508ba3872e72..c9dc417878e7 100644
@@ -471,6 +471,8 @@ struct xe_device {
  	/** @pm_notifier: Our PM notifier to perform actions in response to various PM events. */
  	struct notifier_block pm_notifier;
+	/** @pm_notifier_active: PM notifier prepare work was performed */
+	bool pm_notifier_active;
  	/** @pm_block: Completion to block validating tasks on suspend / hibernate prepare */
  	struct completion pm_block;
  	/** @rebind_resume_list: List of wq items to kick on resume. */
drivers/gpu/drm/xe/xe_pm.c +0 -1
index 720e083cd279..dd7fd170bc94 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
Quoted 8 lines

drivers/gpu/drm/xe/xe_pm.c static int xe_pm_notifier_callback(struct notifier_block *nb, · line 461

Quoted 7 lines

+++ b/drivers/gpu/drm/xe/xe_pm.c

drivers/gpu/drm/xe/xe_pm.c +3 -0
@@ -457,9 +457,14 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
  	{
  		struct xe_validation_ctx ctx;
+		/* Do not start PM preparation after a wedge is declared. */
+		if (xe_device_wedged(xe))
+			break;

perhaps we need to return NOTIFY_BAD ?!

Quoted 6 lines

Thanks for the review.
I do not think NOTIFY_BAD is needed here. A permanently wedged device should not prevent system suspend. pm_notifier_call_chain_robust() passes the notifier result to notifier_to_errno(). NOTIFY_BAD becomes -EPERM, which will aborts system suspend.

ack

Quoted 27 lines

~Arvind

Quoted 24 lines
Quoted 24 lines
drivers/gpu/drm/xe/xe_pm.c +7 -0
+
  		reinit_completion(&xe->pm_block);
  		xe_pm_block_begin_signalling();
  		xe_pm_runtime_get(xe);
+		xe->pm_notifier_active = true;
  		(void)xe_validation_ctx_init(&ctx, &xe->val, NULL,
  					     (struct xe_val_flags) {.exclusive = true});
  		err = xe_bo_evict_all_user(xe);
@@ -480,6 +485,11 @@ static int xe_pm_notifier_callback(struct notifier_block *nb,
  	}
  	case PM_POST_HIBERNATION:
  	case PM_POST_SUSPEND:
+		if (!xe->pm_notifier_active)
+			break;
+
+		xe->pm_notifier_active = false;
+
  		complete_all(&xe->pm_block);
  		xe_pm_wake_rebind_workers(xe);
  		xe_bo_notifier_unprepare_all_pinned(xe);
Signature · 1 line
2.43.0
#44 lore raw

PATCH 13/13 drm/xe: Block BO VM access when device I/O is unavailable

In reply to Arvind Yadav

xe_bo_vm_access() may acquire a runtime PM reference and access a BO during PCI error recovery, after a permanent wedge or during device unplug.

Return -EIO when device I/O is blocked. Use drm_dev_enter() to protect against concurrent unplug and keep that protection until the runtime PM reference has been released.

Use the same SRCU domain as CPU faults so wedge isolation waits for a BO access that started before the wedge.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8
---
 drivers/gpu/drm/xe/xe_bo.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_bo.c +18 -2
index 1eabece56f6c..717d318c7072 100644
@@ -2245,9 +2245,25 @@ static int xe_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
 	struct ttm_buffer_object *ttm_bo = vma->vm_private_data;
 	struct xe_bo *bo = ttm_to_xe_bo(ttm_bo);
 	struct xe_device *xe = xe_bo_device(bo);
+	int idx, srcu_idx, ret = -EIO;
 
-	guard(xe_pm_runtime)(xe);
-	return ttm_bo_vm_access(vma, addr, buf, len, write);
+	srcu_idx = srcu_read_lock(&xe->mem_access.vram_userfault.srcu);
+
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx))
+		goto out_srcu;
+
+	/*
+	 * Keep the drm_dev_enter() protection until the runtime PM
+	 * reference has been released.
+	 */
+	scoped_guard(xe_pm_runtime, xe)
+		ret = ttm_bo_vm_access(vma, addr, buf, len, write);
+
+	drm_dev_exit(idx);
+
+out_srcu:
+	srcu_read_unlock(&xe->mem_access.vram_userfault.srcu, srcu_idx);
+	return ret;
 }
 
 /**
Signature · 1 line
2.43.0
#45 lore raw

Re: [PATCH 13/13] drm/xe: Block BO VM access when device I/O is unavailable

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The function `xe_bo_vm_access` mixes goto-based error handling with scope-based cleanup helpers…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The function xe_bo_vm_access mixes goto-based error handling with scope-based cleanup helpers, violating kernel cleanup guidelines. --

commit ab2c90ef1f693fb22833ef442c6ad80ec3443ca6
Author: Arvind Yadav <[email protected]>

drm/xe: Block BO VM access when device I/O is unavailable

This commit modifies xe_bo_vm_access() to return -EIO when device I/O is blocked. It uses drm_dev_enter() to protect against concurrent unplug and protects the block with a userfault SRCU lock.

Quoted 13 lines
drivers/gpu/drm/xe/xe_bo.c +2 -2
index 1eabece56f6c6..717d318c7072d 100644
@@ -2245,9 +2245,25 @@ static int xe_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
 	struct ttm_buffer_object *ttm_bo = vma->vm_private_data;
 	struct xe_bo *bo = ttm_to_xe_bo(ttm_bo);
 	struct xe_device *xe = xe_bo_device(bo);
+	int idx, srcu_idx, ret = -EIO;
 
-	guard(xe_pm_runtime)(xe);
-	return ttm_bo_vm_access(vma, addr, buf, len, write);
+	srcu_idx = srcu_read_lock(&xe->mem_access.vram_userfault.srcu);

drivers/gpu/drm/xe/xe_bo.c static int xe_bo_vm_access(struct vm_area_struct *vma, unsigned long addr, · line 2260

Quoted 10 lines
drivers/gpu/drm/xe/xe_bo.c +10 -0
+
+	if (xe_device_io_blocked(xe) || !drm_dev_enter(&xe->drm, &idx))
+		goto out_srcu;
+
+	/*
+	 * Keep the drm_dev_enter() protection until the runtime PM
+	 * reference has been released.
+	 */
+	scoped_guard(xe_pm_runtime, xe)
+		ret = ttm_bo_vm_access(vma, addr, buf, len, write);

[Severity: Low]
Does this mix goto-based error handling with scope-based cleanup helpers in xe_bo_vm_access()?

According to the cleanup guidelines in include/linux/cleanup.h, the usage of goto and scope-based cleanup helpers should never be mixed in the same function.

Could this create confusing ownership semantics or risk subtle ordering bugs on scope exit? To maintain consistency, would it be better to convert all resources in this function to scope-based cleanup, or stick entirely to goto-based cleanup?

Quoted 9 lines
drivers/gpu/drm/xe/xe_bo.c +6 -0
+
+	drm_dev_exit(idx);
+
+out_srcu:
+	srcu_read_unlock(&xe->mem_access.vram_userfault.srcu, srcu_idx);
+	return ret;
 }
 
 /**
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13
#46 lore raw

✗ CI.checkpatch: warning for drm/xe: Isolate wedged devices from hardware access

In reply to Arvind Yadav
== Series Details ==

== Series Details ==

Series: drm/xe: Isolate wedged devices from hardware access
URL : https://patchwork.freedesktop.org/series/172860/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master 061140b9bc586ae7f40abc1249c97e1cc72d1b9d
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 5a0183e63c0b14db04163704afb9f0e570bf1f85

Author: Arvind Yadav <[email protected]>
Date:   Thu Aug 27 15:48:01 2026 +0530

drm/xe: Block BO VM access when device I/O is unavailable

xe_bo_vm_access() may acquire a runtime PM reference and access a BO during PCI error recovery, after a permanent wedge or during device unplug.

Return -EIO when device I/O is blocked. Use drm_dev_enter() to protect against concurrent unplug and keep that protection until the runtime PM reference has been released.

Use the same SRCU domain as CPU faults so wedge isolation waits for a BO access that started before the wedge.

Cc Matthew Brost <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Himal Prasad Ghimiray <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Assisted-by Claude:claude-opus-4-8

+ /mt/dim checkpatch 098021382451783ea6448fa7f0e2a4cbc395c3d2 drm-intel 3b34b8b642f5 drm/xe/irq: Always free requested IRQs on uninstall 3d0f4dbc0bdf drm/xe: Separate AER reset state from device wedging -:258: CHECK:LINE_SPACING: Please don't use multiple blank lines #258: FILE: drivers/gpu/drm/xe/xe_pci_error.c:22:

+

total: 0 errors, 0 warnings, 1 checks, 222 lines checked cfe1aa2c75bf drm/xe: Drop queued page faults when device I/O is blocked 4fdcb68eeca7 drm/xe: Stop VM work when device I/O is blocked 00c84ece2622 drm/xe: Send wedged notification from a worker 56a5540151d3 drm/xe: Reuse one dummy page per BO after wedge 4fd081486713 drm/xe: Invalidate existing VRAM mappings on wedge d965c4b40905 drm/xe/irq: Serialize IRQ suspend and resume 99b8f4e39b1e drm/xe: Isolate a wedged device before notifying userspace 94d76c78f0b6 drm/xe/ttm: Reject VRAM allocations on wedged devices df1cbd60098f drm/xe/guc: Skip timeout recovery on a wedged device 5ca0fd411f87 drm/xe: Skip PM notifier preparation for wedged devices 5a0183e63c0b drm/xe: Block BO VM access when device I/O is unavailable

#47 lore raw

✓ CI.KUnit: success for drm/xe: Isolate wedged devices from hardware access

In reply to Arvind Yadav
== Series Details ==

== Series Details ==

Series: drm/xe: Isolate wedged devices from hardware access
URL : https://patchwork.freedesktop.org/series/172860/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig [10:24:27] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[10:24:31] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[10:25:04] Starting KUnit Kernel (1/1)...
[10:25:04] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[10:25:04] ================== guc_buf (11 subtests) ===================
[10:25:04] [PASSED] test_smallest
[10:25:04] [PASSED] test_largest
[10:25:04] [PASSED] test_granular
[10:25:04] [PASSED] test_unique
[10:25:04] [PASSED] test_overlap
[10:25:04] [PASSED] test_reusable
[10:25:04] [PASSED] test_too_big
[10:25:04] [PASSED] test_flush
[10:25:04] [PASSED] test_lookup
[10:25:04] [PASSED] test_data
[10:25:04] [PASSED] test_class
[10:25:04] ===================== [PASSED] guc_buf =====================
[10:25:04] =================== guc_dbm (7 subtests) ===================
[10:25:04] [PASSED] test_empty
[10:25:04] [PASSED] test_default
[10:25:04] ======================== test_size  ========================
[10:25:04] [PASSED] 4
[10:25:04] [PASSED] 8
[10:25:04] [PASSED] 32
[10:25:04] [PASSED] 256
[10:25:04] ==================== [PASSED] test_size ====================
[10:25:04] ======================= test_reuse  ========================
[10:25:04] [PASSED] 4
[10:25:04] [PASSED] 8
[10:25:04] [PASSED] 32
[10:25:04] [PASSED] 256
[10:25:04] =================== [PASSED] test_reuse ====================
[10:25:04] =================== test_range_overlap  ====================
[10:25:04] [PASSED] 4
[10:25:04] [PASSED] 8
[10:25:04] [PASSED] 32
[10:25:04] [PASSED] 256
[10:25:04] =============== [PASSED] test_range_overlap ================
[10:25:04] =================== test_range_compact  ====================
[10:25:04] [PASSED] 4
[10:25:04] [PASSED] 8
[10:25:04] [PASSED] 32
[10:25:04] [PASSED] 256
[10:25:04] =============== [PASSED] test_range_compact ================
[10:25:04] ==================== test_range_spare  =====================
[10:25:04] [PASSED] 4
[10:25:04] [PASSED] 8
[10:25:04] [PASSED] 32
[10:25:04] [PASSED] 256
[10:25:04] ================ [PASSED] test_range_spare =================
[10:25:04] ===================== [PASSED] guc_dbm =====================
[10:25:04] =================== guc_idm (6 subtests) ===================
[10:25:04] [PASSED] bad_init
[10:25:04] [PASSED] no_init
[10:25:04] [PASSED] init_fini
[10:25:04] [PASSED] check_used
[10:25:04] [PASSED] check_quota
[10:25:04] [PASSED] check_all
[10:25:04] ===================== [PASSED] guc_idm =====================
[10:25:04] =============== guc_klv_helpers (9 subtests) ===============
[10:25:04] [PASSED] test_count
[10:25:04] [PASSED] test_encode_u32
[10:25:04] [PASSED] test_encode_u64
[10:25:04] [PASSED] test_encode_string
[10:25:04] [PASSED] test_encode_object_raw
[10:25:04] [PASSED] test_encode_object_klv
[10:25:04] [PASSED] test_encode_object_nested
[10:25:04] [PASSED] test_encode_object_basic
[10:25:04] [PASSED] test_print
[10:25:04] ================= [PASSED] guc_klv_helpers =================
[10:25:04] =================== xe_log (4 subtests) ====================
[10:25:04] [PASSED] demo_cper
[10:25:04] [PASSED] demo_dmesg
[10:25:04] ======================= test_dmesg  ========================
[10:25:04] [PASSED] test_fatal
[10:25:04] [PASSED] test_fatal_tile
[10:25:04] [PASSED] test_fatal_gt
[10:25:04] [PASSED] test_fatal_comp
[10:25:04] [PASSED] test_fatal_comp_tile
[10:25:04] [PASSED] test_fatal_comp_gt
[10:25:04] [PASSED] test_fatal_all
[10:25:04] [PASSED] test_recoverable
[10:25:04] [PASSED] test_recoverable_tile
[10:25:04] [PASSED] test_recoverable_gt
[10:25:04] [PASSED] test_recoverable_comp
[10:25:04] [PASSED] test_recoverable_comp_tile
[10:25:04] [PASSED] test_recoverable_comp_gt
[10:25:04] [PASSED] test_recoverable_all
[10:25:04] [PASSED] test_info
[10:25:04] [PASSED] test_info_tile
[10:25:04] [PASSED] test_info_gt
[10:25:04] [PASSED] test_info_err
[10:25:04] [PASSED] test_info_comp
[10:25:04] [PASSED] test_info_comp_tile
[10:25:04] [PASSED] test_info_comp_gt
[10:25:04] [PASSED] test_info_all
[10:25:04] [PASSED] test_hw_fatal
[10:25:04] [PASSED] test_hw_recoverable
[10:25:04] [PASSED] test_hw_corrected
[10:25:04] [PASSED] test_hw_informational
[10:25:04] =================== [PASSED] test_dmesg ====================
[10:25:04] ====================== test_invalid  =======================
[10:25:04] [SKIPPED] no-component no-location no-warn (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] reserved location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] unknown location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] nonzero-device-id location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] invalid-tile-id location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] invalid-gt-id location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] unknown component class (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] unknown system component (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] unknown hardware component (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] [SKIPPED] unknown component and location (requires CONFIG_DRM_XE_DEBUG)
[10:25:04] ================== [SKIPPED] test_invalid ==================
[10:25:04] ===================== [PASSED] xe_log ======================
[10:25:04] ================== no_relay (3 subtests) ===================
[10:25:04] [PASSED] xe_drops_guc2pf_if_not_ready
[10:25:04] [PASSED] xe_drops_guc2vf_if_not_ready
[10:25:04] [PASSED] xe_rejects_send_if_not_ready
[10:25:04] ==================== [PASSED] no_relay =====================
[10:25:04] ================== pf_relay (14 subtests) ==================
[10:25:04] [PASSED] pf_rejects_guc2pf_too_short
[10:25:04] [PASSED] pf_rejects_guc2pf_too_long
[10:25:04] [PASSED] pf_rejects_guc2pf_no_payload
[10:25:04] [PASSED] pf_fails_no_payload
[10:25:04] [PASSED] pf_fails_bad_origin
[10:25:04] [PASSED] pf_fails_bad_type
[10:25:04] [PASSED] pf_txn_reports_error
[10:25:04] [PASSED] pf_txn_sends_pf2guc
[10:25:04] [PASSED] pf_sends_pf2guc
[10:25:04] [SKIPPED] pf_loopback_nop (requires CONFIG_DRM_XE_DEBUG_SRIOV)
[10:25:04] [SKIPPED] pf_loopback_echo (requires CONFIG_DRM_XE_DEBUG_SRIOV)
[10:25:04] [SKIPPED] pf_loopback_fail (requires CONFIG_DRM_XE_DEBUG_SRIOV)
[10:25:04] [SKIPPED] pf_loopback_busy (requires CONFIG_DRM_XE_DEBUG_SRIOV)
[10:25:04] [SKIPPED] pf_loopback_retry (requires CONFIG_DRM_XE_DEBUG_SRIOV)
[10:25:04] ==================== [PASSED] pf_relay =====================
[10:25:04] ================== vf_relay (3 subtests) ===================
[10:25:04] [PASSED] vf_rejects_guc2vf_too_short
[10:25:04] [PASSED] vf_rejects_guc2vf_too_long
[10:25:04] [PASSED] vf_rejects_guc2vf_no_payload
[10:25:04] ==================== [PASSED] vf_relay =====================
[10:25:04] ================ pf_gt_config (9 subtests) =================
[10:25:04] [PASSED] fair_contexts_1vf
[10:25:04] [PASSED] fair_doorbells_1vf
[10:25:04] [PASSED] fair_ggtt_1vf
[10:25:04] ====================== fair_vram_1vf  ======================
[10:25:04] [PASSED] 3.50 GiB
[10:25:04] [PASSED] 11.5 GiB
[10:25:04] [PASSED] 15.5 GiB
[10:25:04] [PASSED] 31.5 GiB
[10:25:04] [PASSED] 63.5 GiB
[10:25:04] [PASSED] 1.91 GiB
[10:25:04] ================== [PASSED] fair_vram_1vf ==================
[10:25:04] ================ fair_vram_1vf_admin_only  =================
[10:25:04] [PASSED] 3.50 GiB
[10:25:04] [PASSED] 11.5 GiB
[10:25:04] [PASSED] 15.5 GiB
[10:25:04] [PASSED] 31.5 GiB
[10:25:04] [PASSED] 63.5 GiB
[10:25:04] [PASSED] 1.91 GiB
[10:25:04] ============ [PASSED] fair_vram_1vf_admin_only =============
[10:25:04] ====================== fair_contexts  ======================
[10:25:04] [PASSED] 1 VF
[10:25:04] [PASSED] 2 VFs
[10:25:04] [PASSED] 3 VFs
[10:25:04] [PASSED] 4 VFs
[10:25:04] [PASSED] 5 VFs
[10:25:04] [PASSED] 6 VFs
[10:25:04] [PASSED] 7 VFs
[10:25:04] [PASSED] 8 VFs
[10:25:04] [PASSED] 9 VFs
[10:25:04] [PASSED] 10 VFs
[10:25:04] [PASSED] 11 VFs
[10:25:04] [PASSED] 12 VFs
[10:25:04] [PASSED] 13 VFs
[10:25:04] [PASSED] 14 VFs
[10:25:04] [PASSED] 15 VFs
[10:25:04] [PASSED] 16 VFs
[10:25:04] [PASSED] 17 VFs
[10:25:04] [PASSED] 18 VFs
[10:25:04] [PASSED] 19 VFs
[10:25:04] [PASSED] 20 VFs
[10:25:04] [PASSED] 21 VFs
[10:25:04] [PASSED] 22 VFs
[10:25:04] [PASSED] 23 VFs
[10:25:04] [PASSED] 24 VFs
[10:25:04] [PASSED] 25 VFs
[10:25:04] [PASSED] 26 VFs
[10:25:04] [PASSED] 27 VFs
[10:25:04] [PASSED] 28 VFs
[10:25:04] [PASSED] 29 VFs
[10:25:04] [PASSED] 30 VFs
[10:25:04] [PASSED] 31 VFs
[10:25:04] [PASSED] 32 VFs
[10:25:04] [PASSED] 33 VFs
[10:25:04] [PASSED] 34 VFs
[10:25:04] [PASSED] 35 VFs
[10:25:04] [PASSED] 36 VFs
[10:25:04] [PASSED] 37 VFs
[10:25:04] [PASSED] 38 VFs
[10:25:04] [PASSED] 39 VFs
[10:25:04] [PASSED] 40 VFs
[10:25:04] [PASSED] 41 VFs
[10:25:04] [PASSED] 42 VFs
[10:25:04] [PASSED] 43 VFs
[10:25:04] [PASSED] 44 VFs
[10:25:04] [PASSED] 45 VFs
[10:25:04] [PASSED] 46 VFs
[10:25:04] [PASSED] 47 VFs
[10:25:04] [PASSED] 48 VFs
[10:25:04] [PASSED] 49 VFs
[10:25:04] [PASSED] 50 VFs
[10:25:04] [PASSED] 51 VFs
[10:25:04] [PASSED] 52 VFs
[10:25:04] [PASSED] 53 VFs
[10:25:04] [PASSED] 54 VFs
[10:25:04] [PASSED] 55 VFs
[10:25:04] [PASSED] 56 VFs
[10:25:04] [PASSED] 57 VFs
[10:25:04] [PASSED] 58 VFs
[10:25:04] [PASSED] 59 VFs
[10:25:04] [PASSED] 60 VFs
[10:25:04] [PASSED] 61 VFs
[10:25:04] [PASSED] 62 VFs
[10:25:04] [PASSED] 63 VFs
[10:25:04] ================== [PASSED] fair_contexts ==================
[10:25:04] ===================== fair_doorbells  ======================
[10:25:04] [PASSED] 1 VF
[10:25:04] [PASSED] 2 VFs
[10:25:04] [PASSED] 3 VFs
[10:25:04] [PASSED] 4 VFs
[10:25:04] [PASSED] 5 VFs
[10:25:04] [PASSED] 6 VFs
[10:25:04] [PASSED] 7 VFs
[10:25:04] [PASSED] 8 VFs
[10:25:04] [PASSED] 9 VFs
[10:25:04] [PASSED] 10 VFs
[10:25:04] [PASSED] 11 VFs
[10:25:04] [PASSED] 12 VFs
[10:25:04] [PASSED] 13 VFs
[10:25:04] [PASSED] 14 VFs
[10:25:04] [PASSED] 15 VFs
[10:25:04] [PASSED] 16 VFs
[10:25:04] [PASSED] 17 VFs
[10:25:04] [PASSED] 18 VFs
[10:25:04] [PASSED] 19 VFs
[10:25:04] [PASSED] 20 VFs
[10:25:04] [PASSED] 21 VFs
[10:25:04] [PASSED] 22 VFs
[10:25:04] [PASSED] 23 VFs
[10:25:04] [PASSED] 24 VFs
[10:25:04] [PASSED] 25 VFs
[10:25:04] [PASSED] 26 VFs
[10:25:04] [PASSED] 27 VFs
[10:25:04] [PASSED] 28 VFs
[10:25:04] [PASSED] 29 VFs
[10:25:04] [PASSED] 30 VFs
[10:25:04] [PASSED] 31 VFs
[10:25:04] [PASSED] 32 VFs
[10:25:04] [PASSED] 33 VFs
[10:25:04] [PASSED] 34 VFs
[10:25:04] [PASSED] 35 VFs
[10:25:04] [PASSED] 36 VFs
[10:25:04] [PASSED] 37 VFs
[10:25:04] [PASSED] 38 VFs
[10:25:04] [PASSED] 39 VFs
[10:25:04] [PASSED] 40 VFs
[10:25:04] [PASSED] 41 VFs
[10:25:04] [PASSED] 42 VFs
[10:25:04] [PASSED] 43 VFs
[10:25:04] [PASSED] 44 VFs
[10:25:04] [PASSED] 45 VFs
[10:25:04] [PASSED] 46 VFs
[10:25:04] [PASSED] 47 VFs
[10:25:04] [PASSED] 48 VFs
[10:25:04] [PASSED] 49 VFs
[10:25:04] [PASSED] 50 VFs
[10:25:04] [PASSED] 51 VFs
[10:25:04] [PASSED] 52 VFs
[10:25:04] [PASSED] 53 VFs
[10:25:04] [PASSED] 54 VFs
[10:25:04] [PASSED] 55 VFs
[10:25:04] [PASSED] 56 VFs
[10:25:04] [PASSED] 57 VFs
[10:25:04] [PASSED] 58 VFs
[10:25:04] [PASSED] 59 VFs
[10:25:04] [PASSED] 60 VFs
[10:25:04] [PASSED] 61 VFs
[10:25:04] [PASSED] 62 VFs
[10:25:04] [PASSED] 63 VFs
[10:25:04] ================= [PASSED] fair_doorbells ==================
[10:25:04] ======================== fair_ggtt  ========================
[10:25:04] [PASSED] 1 VF
[10:25:04] [PASSED] 2 VFs
[10:25:04] [PASSED] 3 VFs
[10:25:04] [PASSED] 4 VFs
[10:25:04] [PASSED] 5 VFs
[10:25:04] [PASSED] 6 VFs
[10:25:04] [PASSED] 7 VFs
[10:25:04] [PASSED] 8 VFs
[10:25:04] [PASSED] 9 VFs
[10:25:04] [PASSED] 10 VFs
[10:25:04] [PASSED] 11 VFs
[10:25:04] [PASSED] 12 VFs
[10:25:04] [PASSED] 13 VFs
[10:25:04] [PASSED] 14 VFs
[10:25:04] [PASSED] 15 VFs
[10:25:04] [PASSED] 16 VFs
[10:25:04] [PASSED] 17 VFs
[10:25:04] [PASSED] 18 VFs
[10:25:04] [PASSED] 19 VFs
[10:25:04] [PASSED] 20 VFs
[10:25:04] [PASSED] 21 VFs
[10:25:04] [PASSED] 22 VFs
[10:25:04] [PASSED] 23 VFs
[10:25:04] [PASSED] 24 VFs
[10:25:04] [PASSED] 25 VFs
[10:25:04] [PASSED] 26 VFs
[10:25:04] [PASSED] 27 VFs
[10:25:04] [PASSED] 28 VFs
[10:25:04] [PASSED] 29 VFs
[10:25:04] [PASSED] 30 VFs
[10:25:04] [PASSED] 31 VFs
[10:25:04] [PASSED] 32 VFs
[10:25:04] [PASSED] 33 VFs
[10:25:04] [PASSED] 34 VFs
[10:25:04] [PASSED] 35 VFs
[10:25:04] [PASSED] 36 VFs
[10:25:04] [PASSED] 37 VFs
[10:25:04] [PASSED] 38 VFs
[10:25:04] [PASSED] 39 VFs
[10:25:04] [PASSED] 40 VFs
[10:25:04] [PASSED] 41 VFs
[10:25:04] [PASSED] 42 VFs
[10:25:04] [PASSED] 43 VFs
[10:25:04] [PASSED] 44 VFs
[10:25:04] [PASSED] 45 VFs
[10:25:04] [PASSED] 46 VFs
[10:25:04] [PASSED] 47 VFs
[10:25:04] [PASSED] 48 VFs
[10:25:04] [PASSED] 49 VFs
[10:25:04] [PASSED] 50 VFs
[10:25:04] [PASSED] 51 VFs
[10:25:04] [PASSED] 52 VFs
[10:25:04] [PASSED] 53 VFs
[10:25:04] [PASSED] 54 VFs
[10:25:04] [PASSED] 55 VFs
[10:25:04] [PASSED] 56 VFs
[10:25:04] [PASSED] 57 VFs
[10:25:04] [PASSED] 58 VFs
[10:25:04] [PASSED] 59 VFs
[10:25:04] [PASSED] 60 VFs
[10:25:04] [PASSED] 61 VFs
[10:25:04] [PASSED] 62 VFs
[10:25:04] [PASSED] 63 VFs
[10:25:04] ==================== [PASSED] fair_ggtt ====================
[10:25:04] ======================== fair_vram  ========================
[10:25:04] [PASSED] 1 VF
[10:25:04] [PASSED] 2 VFs
[10:25:04] [PASSED] 3 VFs
[10:25:04] [PASSED] 4 VFs
[10:25:04] [PASSED] 5 VFs
[10:25:04] [PASSED] 6 VFs
[10:25:04] [PASSED] 7 VFs
[10:25:04] [PASSED] 8 VFs
[10:25:04] [PASSED] 9 VFs
[10:25:04] [PASSED] 10 VFs
[10:25:04] [PASSED] 11 VFs
[10:25:04] [PASSED] 12 VFs
[10:25:04] [PASSED] 13 VFs
[10:25:04] [PASSED] 14 VFs
[10:25:04] [PASSED] 15 VFs
[10:25:04] [PASSED] 16 VFs
[10:25:04] [PASSED] 17 VFs
[10:25:04] [PASSED] 18 VFs
[10:25:04] [PASSED] 19 VFs
[10:25:04] [PASSED] 20 VFs
[10:25:04] [PASSED] 21 VFs
[10:25:04] [PASSED] 22 VFs
[10:25:04] [PASSED] 23 VFs
[10:25:04] [PASSED] 24 VFs
[10:25:04] [PASSED] 25 VFs
[10:25:04] [PASSED] 26 VFs
[10:25:04] [PASSED] 27 VFs
[10:25:04] [PASSED] 28 VFs
[10:25:04] [PASSED] 29 VFs
[10:25:04] [PASSED] 30 VFs
[10:25:04] [PASSED] 31 VFs
[10:25:04] [PASSED] 32 VFs
[10:25:04] [PASSED] 33 VFs
[10:25:04] [PASSED] 34 VFs
[10:25:04] [PASSED] 35 VFs
[10:25:04] [PASSED] 36 VFs
[10:25:04] [PASSED] 37 VFs
[10:25:04] [PASSED] 38 VFs
[10:25:04] [PASSED] 39 VFs
[10:25:04] [PASSED] 40 VFs
[10:25:04] [PASSED] 41 VFs
[10:25:04] [PASSED] 42 VFs
[10:25:04] [PASSED] 43 VFs
[10:25:04] [PASSED] 44 VFs
[10:25:04] [PASSED] 45 VFs
[10:25:04] [PASSED] 46 VFs
[10:25:04] [PASSED] 47 VFs
[10:25:04] [PASSED] 48 VFs
[10:25:04] [PASSED] 49 VFs
[10:25:04] [PASSED] 50 VFs
[10:25:04] [PASSED] 51 VFs
[10:25:04] [PASSED] 52 VFs
[10:25:04] [PASSED] 53 VFs
[10:25:04] [PASSED] 54 VFs
[10:25:04] [PASSED] 55 VFs
[10:25:04] [PASSED] 56 VFs
[10:25:04] [PASSED] 57 VFs
[10:25:04] [PASSED] 58 VFs
[10:25:04] [PASSED] 59 VFs
[10:25:04] [PASSED] 60 VFs
[10:25:04] [PASSED] 61 VFs
[10:25:04] [PASSED] 62 VFs
[10:25:04] [PASSED] 63 VFs
[10:25:04] ==================== [PASSED] fair_vram ====================
[10:25:04] ================== [PASSED] pf_gt_config ===================
[10:25:04] ===================== lmtt (1 subtest) =====================
[10:25:04] ======================== test_ops  =========================
[10:25:04] [PASSED] 2-level
[10:25:04] [PASSED] multi-level
[10:25:04] ==================== [PASSED] test_ops =====================
[10:25:04] ====================== [PASSED] lmtt =======================
[10:25:04] ================= sriov_packet (1 subtest) =================
[10:25:04] [PASSED] test_descriptor_init
[10:25:04] ================== [PASSED] sriov_packet ===================
[10:25:04] ================= pf_service (11 subtests) =================
[10:25:04] [PASSED] pf_negotiate_any
[10:25:04] [PASSED] pf_negotiate_base_match
[10:25:04] [PASSED] pf_negotiate_base_newer
[10:25:04] [PASSED] pf_negotiate_base_next
[10:25:04] [SKIPPED] pf_negotiate_base_older (no older minor)
[10:25:04] [PASSED] pf_negotiate_base_prev
[10:25:04] [PASSED] pf_negotiate_latest_match
[10:25:04] [PASSED] pf_negotiate_latest_newer
[10:25:04] [PASSED] pf_negotiate_latest_next
[10:25:04] [SKIPPED] pf_negotiate_latest_older (no older minor)
[10:25:04] [SKIPPED] pf_negotiate_latest_prev (no prev major)
[10:25:04] =================== [PASSED] pf_service ====================
[10:25:04] ================= xe_guc_g2g (2 subtests) ==================
[10:25:04] ============== xe_live_guc_g2g_kunit_default  ==============
[10:25:04] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[10:25:04] ============== xe_live_guc_g2g_kunit_allmem  ===============
[10:25:04] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[10:25:04] =================== [SKIPPED] xe_guc_g2g ===================
[10:25:04] =================== xe_mocs (2 subtests) ===================
[10:25:04] ================ xe_live_mocs_kernel_kunit  ================
[10:25:04] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[10:25:04] ================ xe_live_mocs_reset_kunit  =================
[10:25:04] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[10:25:04] ==================== [SKIPPED] xe_mocs =====================
[10:25:04] ================= xe_migrate (2 subtests) ==================
[10:25:04] ================= xe_migrate_sanity_kunit  =================
[10:25:04] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[10:25:04] ================== xe_validate_ccs_kunit  ==================
[10:25:04] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[10:25:04] =================== [SKIPPED] xe_migrate ===================
[10:25:04] ================== xe_dma_buf (1 subtest) ==================
[10:25:04] ==================== xe_dma_buf_kunit  =====================
[10:25:04] ================ [SKIPPED] xe_dma_buf_kunit ================
[10:25:04] =================== [SKIPPED] xe_dma_buf ===================
[10:25:04] ================= xe_bo_shrink (1 subtest) =================
[10:25:04] =================== xe_bo_shrink_kunit  ====================
[10:25:04] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[10:25:04] ================== [SKIPPED] xe_bo_shrink ==================
[10:25:04] ==================== xe_bo (2 subtests) ====================
[10:25:04] ================== xe_ccs_migrate_kunit  ===================
[10:25:04] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[10:25:04] ==================== xe_bo_evict_kunit  ====================
[10:25:04] =============== [SKIPPED] xe_bo_evict_kunit ================
[10:25:04] ===================== [SKIPPED] xe_bo ======================
[10:25:04] =================== xe_any (9 subtests) ====================
[10:25:04] [PASSED] test_to_xe
[10:25:04] [PASSED] test_to_dev
[10:25:04] [PASSED] test_to_pdev
[10:25:04] [PASSED] test_to_drm
[10:25:04] [PASSED] test_if_pdev
[10:25:04] [PASSED] test_if_xe
[10:25:04] [PASSED] test_if_tile
[10:25:04] [PASSED] test_if_gt
[10:25:04] [PASSED] test_to_id
[10:25:04] ===================== [PASSED] xe_any ======================
[10:25:04] ==================== args (13 subtests) ====================
[10:25:04] [PASSED] count_args_test
[10:25:04] [PASSED] call_args_example
[10:25:04] [PASSED] call_args_test
[10:25:04] [PASSED] drop_first_arg_example
[10:25:04] [PASSED] drop_first_arg_test
[10:25:04] [PASSED] first_arg_example
[10:25:04] [PASSED] first_arg_test
[10:25:04] [PASSED] last_arg_example
[10:25:04] [PASSED] last_arg_test
[10:25:04] [PASSED] pick_arg_example
[10:25:04] [PASSED] if_args_example
[10:25:04] [PASSED] if_args_test
[10:25:04] [PASSED] sep_comma_example
[10:25:04] ====================== [PASSED] args =======================
[10:25:04] =================== xe_pci (3 subtests) ====================
[10:25:04] ==================== check_graphics_ip  ====================
[10:25:04] [PASSED] 12.00 Xe_LP
[10:25:04] [PASSED] 12.10 Xe_LP+
[10:25:04] [PASSED] 12.55 Xe_HPG
[10:25:04] [PASSED] 12.60 Xe_HPC
[10:25:04] [PASSED] 12.70 Xe_LPG
[10:25:04] [PASSED] 12.71 Xe_LPG
[10:25:04] [PASSED] 12.74 Xe_LPG+
[10:25:04] [PASSED] 20.01 Xe2_HPG
[10:25:04] [PASSED] 20.02 Xe2_HPG
[10:25:04] [PASSED] 20.04 Xe2_LPG
[10:25:04] [PASSED] 30.00 Xe3_LPG
[10:25:04] [PASSED] 30.01 Xe3_LPG
[10:25:04] [PASSED] 30.03 Xe3_LPG
[10:25:04] [PASSED] 30.04 Xe3_LPG
[10:25:04] [PASSED] 30.05 Xe3_LPG
[10:25:04] [PASSED] 35.10 Xe3p_LPG
[10:25:04] [PASSED] 35.11 Xe3p_XPC
[10:25:04] ================ [PASSED] check_graphics_ip ================
[10:25:04] ===================== check_media_ip  ======================
[10:25:04] [PASSED] 12.00 Xe_M
[10:25:04] [PASSED] 12.55 Xe_HPM
[10:25:04] [PASSED] 13.00 Xe_LPM+
[10:25:04] [PASSED] 13.01 Xe2_HPM
[10:25:04] [PASSED] 20.00 Xe2_LPM
[10:25:04] [PASSED] 30.00 Xe3_LPM
[10:25:04] [PASSED] 30.02 Xe3_LPM
[10:25:04] [PASSED] 35.00 Xe3p_LPM
[10:25:04] [PASSED] 35.03 Xe3p_HPM
[10:25:04] ================= [PASSED] check_media_ip ==================
[10:25:04] =================== check_platform_desc  ===================
[10:25:04] [PASSED] 0x9A60 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A68 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A70 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A40 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A49 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A59 (TIGERLAKE)
[10:25:04] [PASSED] 0x9A78 (TIGERLAKE)
[10:25:04] [PASSED] 0x9AC0 (TIGERLAKE)
[10:25:04] [PASSED] 0x9AC9 (TIGERLAKE)
[10:25:04] [PASSED] 0x9AD9 (TIGERLAKE)
[10:25:04] [PASSED] 0x9AF8 (TIGERLAKE)
[10:25:04] [PASSED] 0x4C80 (ROCKETLAKE)
[10:25:04] [PASSED] 0x4C8A (ROCKETLAKE)
[10:25:04] [PASSED] 0x4C8B (ROCKETLAKE)
[10:25:04] [PASSED] 0x4C8C (ROCKETLAKE)
[10:25:04] [PASSED] 0x4C90 (ROCKETLAKE)
[10:25:04] [PASSED] 0x4C9A (ROCKETLAKE)
[10:25:04] [PASSED] 0x4680 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4682 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4688 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x468A (ALDERLAKE_S)
[10:25:04] [PASSED] 0x468B (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4690 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4692 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4693 (ALDERLAKE_S)
[10:25:04] [PASSED] 0x46A0 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46A1 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46A2 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46A3 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46A6 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46A8 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46AA (ALDERLAKE_P)
[10:25:04] [PASSED] 0x462A (ALDERLAKE_P)
[10:25:04] [PASSED] 0x4626 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x4628 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46B0 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46B1 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46B2 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46B3 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46C0 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46C1 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46C2 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46C3 (ALDERLAKE_P)
[10:25:04] [PASSED] 0x46D0 (ALDERLAKE_N)
[10:25:04] [PASSED] 0x46D1 (ALDERLAKE_N)
[10:25:04] [PASSED] 0x46D2 (ALDERLAKE_N)
[10:25:04] [PASSED] 0x46D3 (ALDERLAKE_N)
[10:25:04] [PASSED] 0x46D4 (ALDERLAKE_N)
[10:25:04] [PASSED] 0xA721 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7A1 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7A9 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7AC (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7AD (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA720 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7A0 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7A8 (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7AA (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA7AB (ALDERLAKE_P)
[10:25:04] [PASSED] 0xA780 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA781 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA782 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA783 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA788 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA789 (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA78A (ALDERLAKE_S)
[10:25:04] [PASSED] 0xA78B (ALDERLAKE_S)
[10:25:04] [PASSED] 0x4905 (DG1)
[10:25:04] [PASSED] 0x4906 (DG1)
[10:25:04] [PASSED] 0x4907 (DG1)
[10:25:04] [PASSED] 0x4908 (DG1)
[10:25:04] [PASSED] 0x4909 (DG1)
[10:25:04] [PASSED] 0x56C0 (DG2)
[10:25:04] [PASSED] 0x56C2 (DG2)
[10:25:04] [PASSED] 0x56C1 (DG2)
[10:25:04] [PASSED] 0x7D51 (METEORLAKE)
[10:25:04] [PASSED] 0x7DD1 (METEORLAKE)
[10:25:04] [PASSED] 0x7D41 (METEORLAKE)
[10:25:04] [PASSED] 0x7D67 (METEORLAKE)
[10:25:04] [PASSED] 0xB640 (METEORLAKE)
[10:25:04] [PASSED] 0x56A0 (DG2)
[10:25:04] [PASSED] 0x56A1 (DG2)
[10:25:04] [PASSED] 0x56A2 (DG2)
[10:25:04] [PASSED] 0x56BE (DG2)
[10:25:04] [PASSED] 0x56BF (DG2)
[10:25:04] [PASSED] 0x5690 (DG2)
[10:25:04] [PASSED] 0x5691 (DG2)
[10:25:04] [PASSED] 0x5692 (DG2)
[10:25:04] [PASSED] 0x56A5 (DG2)
[10:25:04] [PASSED] 0x56A6 (DG2)
[10:25:04] [PASSED] 0x56B0 (DG2)
[10:25:04] [PASSED] 0x56B1 (DG2)
[10:25:04] [PASSED] 0x56BA (DG2)
[10:25:04] [PASSED] 0x56BB (DG2)
[10:25:04] [PASSED] 0x56BC (DG2)
[10:25:04] [PASSED] 0x56BD (DG2)
[10:25:04] [PASSED] 0x5693 (DG2)
[10:25:04] [PASSED] 0x5694 (DG2)
[10:25:04] [PASSED] 0x5695 (DG2)
[10:25:04] [PASSED] 0x56A3 (DG2)
[10:25:04] [PASSED] 0x56A4 (DG2)
[10:25:04] [PASSED] 0x56B2 (DG2)
[10:25:04] [PASSED] 0x56B3 (DG2)
[10:25:04] [PASSED] 0x5696 (DG2)
[10:25:04] [PASSED] 0x5697 (DG2)
[10:25:04] [PASSED] 0xB69 (PVC)
[10:25:04] [PASSED] 0xB6E (PVC)
[10:25:04] [PASSED] 0xBD4 (PVC)
[10:25:04] [PASSED] 0xBD5 (PVC)
[10:25:04] [PASSED] 0xBD6 (PVC)
[10:25:04] [PASSED] 0xBD7 (PVC)
[10:25:04] [PASSED] 0xBD8 (PVC)
[10:25:04] [PASSED] 0xBD9 (PVC)
[10:25:04] [PASSED] 0xBDA (PVC)
[10:25:04] [PASSED] 0xBDB (PVC)
[10:25:04] [PASSED] 0xBE0 (PVC)
[10:25:04] [PASSED] 0xBE1 (PVC)
[10:25:04] [PASSED] 0xBE5 (PVC)
[10:25:04] [PASSED] 0x7D40 (METEORLAKE)
[10:25:04] [PASSED] 0x7D45 (METEORLAKE)
[10:25:04] [PASSED] 0x7D55 (METEORLAKE)
[10:25:04] [PASSED] 0x7D60 (METEORLAKE)
[10:25:04] [PASSED] 0x7DD5 (METEORLAKE)
[10:25:04] [PASSED] 0x6420 (LUNARLAKE)
[10:25:04] [PASSED] 0x64A0 (LUNARLAKE)
[10:25:04] [PASSED] 0x64B0 (LUNARLAKE)
[10:25:04] [PASSED] 0xE202 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE209 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE20B (BATTLEMAGE)
[10:25:04] [PASSED] 0xE20C (BATTLEMAGE)
[10:25:04] [PASSED] 0xE20D (BATTLEMAGE)
[10:25:04] [PASSED] 0xE210 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE211 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE212 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE216 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE220 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE221 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE222 (BATTLEMAGE)
[10:25:04] [PASSED] 0xE223 (BATTLEMAGE)
[10:25:04] [PASSED] 0xB080 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB081 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB082 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB083 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB084 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB085 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB086 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB087 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB08F (PANTHERLAKE)
[10:25:04] [PASSED] 0xB090 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB0A0 (PANTHERLAKE)
[10:25:04] [PASSED] 0xB0B0 (PANTHERLAKE)
[10:25:04] [PASSED] 0xFD80 (PANTHERLAKE)
[10:25:04] [PASSED] 0xFD81 (PANTHERLAKE)
[10:25:04] [PASSED] 0xD740 (NOVALAKE_S)
[10:25:04] [PASSED] 0xD741 (NOVALAKE_S)
[10:25:04] [PASSED] 0xD742 (NOVALAKE_S)
[10:25:04] [PASSED] 0xD743 (NOVALAKE_S)
[10:25:04] [PASSED] 0xD745 (NOVALAKE_S)
[10:25:04] [PASSED] 0xD74A (NOVALAKE_S)
[10:25:04] [PASSED] 0xD74B (NOVALAKE_S)
[10:25:04] [PASSED] 0x674C (CRESCENTISLAND)
[10:25:04] [PASSED] 0x674D (CRESCENTISLAND)
[10:25:04] [PASSED] 0x674E (CRESCENTISLAND)
[10:25:04] [PASSED] 0x674F (CRESCENTISLAND)
[10:25:04] [PASSED] 0x6750 (CRESCENTISLAND)
[10:25:04] [PASSED] 0xD750 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD751 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD752 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD753 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD754 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD755 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD756 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD757 (NOVALAKE_P)
[10:25:04] [PASSED] 0xD75F (NOVALAKE_P)
[10:25:04] =============== [PASSED] check_platform_desc ===============
[10:25:04] ===================== [PASSED] xe_pci ======================
[10:25:04] ============= xe_rtp_tables_test (5 subtests) ==============
[10:25:04] ================== xe_rtp_table_gt_test  ===================
[10:25:04] [PASSED] gt_was/14011060649
[10:25:04] [PASSED] gt_was/14011059788
[10:25:04] [PASSED] gt_was/14015795083
[10:25:04] [PASSED] gt_was/16021867713
[10:25:04] [PASSED] gt_was/14019449301
[10:25:04] [PASSED] gt_was/16028005424
[10:25:04] [PASSED] gt_was/14026578760
[10:25:04] [PASSED] gt_was/1409420604
[10:25:04] [PASSED] gt_was/1408615072
[10:25:04] [PASSED] gt_was/22010523718
[10:25:04] [PASSED] gt_was/14011006942
[10:25:04] [PASSED] gt_was/14014830051
[10:25:04] [PASSED] gt_was/18018781329
[10:25:04] [PASSED] gt_was/1509235366
[10:25:04] [PASSED] gt_was/18018781329
[10:25:04] [PASSED] gt_was/16016694945
[10:25:04] [PASSED] gt_was/14018575942
[10:25:04] [PASSED] gt_was/22016670082
[10:25:04] [PASSED] gt_was/22016670082
[10:25:04] [PASSED] gt_was/14017421178
[10:25:04] [PASSED] gt_was/16025250150
[10:25:04] [PASSED] gt_was/14021871409
[10:25:04] [PASSED] gt_was/16021865536
[10:25:04] [PASSED] gt_was/14021486841
[10:25:04] [PASSED] gt_was/14025160223
[10:25:04] [PASSED] gt_was/14026144927, 16029437861, 14026127056
[10:25:04] [PASSED] gt_was/14025635424
[10:25:04] [PASSED] gt_was/16028005424
[10:25:04] ============== [PASSED] xe_rtp_table_gt_test ===============
[10:25:04] ================== xe_rtp_table_gt_test  ===================
[10:25:04] [PASSED] gt_tunings/Tuning: Blend Fill Caching Optimization Disable
[10:25:04] [PASSED] gt_tunings/Tuning: 32B Access Enable
[10:25:04] [PASSED] gt_tunings/Tuning: L3 cache
[10:25:04] [PASSED] gt_tunings/Tuning: L3 cache - media
[10:25:04] [PASSED] gt_tunings/Tuning: Compression Overfetch
[10:25:04] [PASSED] gt_tunings/Tuning: Compression Overfetch - media
[10:25:04] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3
[10:25:04] [PASSED] gt_tunings/Tuning: Enable compressible partial write overfetch in L3 - media
[10:25:04] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only
[10:25:04] [PASSED] gt_tunings/Tuning: L2 Overfetch Compressible Only - media
[10:25:04] [PASSED] gt_tunings/Tuning: Stateless compression control
[10:25:04] [PASSED] gt_tunings/Tuning: Stateless compression control - media
[10:25:04] [PASSED] gt_tunings/Tuning: L3 RW flush all Cache
[10:25:04] [PASSED] gt_tunings/Tuning: L3 RW flush all cache - media
[10:25:04] [PASSED] gt_tunings/Tuning: Set STLB Bank Hash Mode to 4KB
[10:25:04] ============== [PASSED] xe_rtp_table_gt_test ===============
[10:25:04] ================== xe_rtp_table_oob_test  ==================
[10:25:04] [PASSED] oob_was/1607983814
[10:25:04] [PASSED] oob_was/16010904313
[10:25:04] [PASSED] oob_was/18022495364
[10:25:04] [PASSED] oob_was/22012773006
[10:25:04] [PASSED] oob_was/14014475959
[10:25:04] [PASSED] oob_was/22011391025
[10:25:04] [PASSED] oob_was/22012727170
[10:25:04] [PASSED] oob_was/22012727685
[10:25:04] [PASSED] oob_was/22016596838
[10:25:04] [PASSED] oob_was/18020744125
[10:25:04] [PASSED] oob_was/1409600907
[10:25:04] [PASSED] oob_was/22014953428
[10:25:04] [PASSED] oob_was/16017236439
[10:25:04] [PASSED] oob_was/14019821291
[10:25:04] [PASSED] oob_was/14015076503
[10:25:04] [PASSED] oob_was/14018913170
[10:25:04] [PASSED] oob_was/14018094691
[10:25:04] [PASSED] oob_was/18024947630
[10:25:04] [PASSED] oob_was/16022287689
[10:25:04] [PASSED] oob_was/13011645652
[10:25:04] [PASSED] oob_was/14022293748
[10:25:04] [PASSED] oob_was/22019794406
[10:25:04] [PASSED] oob_was/22019338487
[10:25:04] [PASSED] oob_was/16023588340
[10:25:04] [PASSED] oob_was/14019789679
[10:25:04] [PASSED] oob_was/14022866841
[10:25:04] [PASSED] oob_was/16021333562
[10:25:04] [PASSED] oob_was/14016712196
[10:25:04] [PASSED] oob_was/14015568240
[10:25:04] [PASSED] oob_was/18013179988
[10:25:04] [PASSED] oob_was/1508761755
[10:25:04] [PASSED] oob_was/16023105232
[10:25:04] [PASSED] oob_was/16026508708
[10:25:04] [PASSED] oob_was/14020001231
[10:25:04] [PASSED] oob_was/16023683509
[10:25:04] [PASSED] oob_was/14025515070
[10:25:04] [PASSED] oob_was/15015404425_disable
[10:25:04] [PASSED] oob_was/16026007364
[10:25:04] [PASSED] oob_was/14020316580
[10:25:04] [PASSED] oob_was/14025883347
[10:25:04] [PASSED] oob_was/16029380221
[10:25:04] [PASSED] oob_was/22022079272
[10:25:04] [PASSED] oob_was/16029897822
[10:25:04] [PASSED] oob_was/14027054324
[10:25:04] ============== [PASSED] xe_rtp_table_oob_test ==============
[10:25:04] ================ xe_rtp_table_dev_oob_test  ================
[10:25:04] [PASSED] device_oob_was/22010954014
[10:25:04] [PASSED] device_oob_was/15015404425
[10:25:04] [PASSED] device_oob_was/22019338487_display
[10:25:04] [PASSED] device_oob_was/14022085890
[10:25:04] [PASSED] device_oob_was/14026539277
[10:25:04] [PASSED] device_oob_was/14026633728
[10:25:04] [PASSED] device_oob_was/14026746987
[10:25:04] [PASSED] device_oob_was/14026779378
[10:25:04] ============ [PASSED] xe_rtp_table_dev_oob_test ============
[10:25:04] ========== xe_rtp_table_missing_upper_bound_test  ==========
[10:25:04] [PASSED] register_whitelist/WaAllowPMDepthAndInvocationCountAccessFromUMD, 1408556865
[10:25:04] [PASSED] register_whitelist/1508744258, 14012131227, 1808121037
[10:25:04] [PASSED] register_whitelist/1806527549
[10:25:04] [PASSED] register_whitelist/allow_read_ctx_timestamp
[10:25:04] [PASSED] register_whitelist/allow_read_queue_timestamp
[10:25:04] [PASSED] register_whitelist/16014440446
[10:25:04] [PASSED] register_whitelist/16017236439
[10:25:04] [PASSED] register_whitelist/16020183090
[10:25:04] [PASSED] register_whitelist/14024997852
[10:25:04] [PASSED] register_whitelist/14024997852
[10:25:04] ====== [PASSED] xe_rtp_table_missing_upper_bound_test ======
[10:25:04] =============== [PASSED] xe_rtp_tables_test ================
[10:25:04] =================== xe_rtp (3 subtests) ====================
[10:25:04] =================== xe_rtp_rules_tests  ====================
[10:25:04] [PASSED] no
[10:25:04] [PASSED] yes
[10:25:04] [PASSED] no-and-no
[10:25:04] [PASSED] no-and-yes
[10:25:04] [PASSED] yes-and-no
[10:25:04] [PASSED] yes-and-yes
[10:25:04] [PASSED] no-or-no
[10:25:04] [PASSED] no-or-yes
[10:25:04] [PASSED] yes-or-no
[10:25:04] [PASSED] yes-or-yes
[10:25:04] [PASSED] no-yes-or-yes-no
[10:25:04] [PASSED] no-yes-or-yes-yes
[10:25:04] [PASSED] yes-yes-or-no-yes
[10:25:04] [PASSED] yes-yes-or-yes-yes
[10:25:04] [PASSED] no-no-or-yes-or-no
[10:25:04] [PASSED] or
[10:25:04] [PASSED] or-yes
[10:25:04] [PASSED] or-no
[10:25:04] [PASSED] yes-or
[10:25:04] [PASSED] no-or
[10:25:04] [PASSED] no-or-or-yes
[10:25:04] [PASSED] yes-or-or-no
[10:25:04] [PASSED] no-or-or-no
[10:25:04] [PASSED] missing-context-engine-class
[10:25:04] [PASSED] missing-context-engine-class-or-yes
[10:25:04] [PASSED] missing-context-engine-class-or-or-yes
[10:25:04] =============== [PASSED] xe_rtp_rules_tests ================
[10:25:04] =============== xe_rtp_process_to_sr_tests  ================
[10:25:04] [PASSED] coalesce-same-reg
[10:25:04] [PASSED] coalesce-same-reg-literal-and-func
[10:25:04] [PASSED] no-match-no-add
[10:25:04] [PASSED] two-regs-two-entries
[10:25:04] [PASSED] clr-one-set-other
[10:25:04] [PASSED] set-field
[10:25:04] [PASSED] conflict-duplicate
[10:25:04] [PASSED] conflict-not-disjoint
[10:25:04] [PASSED] conflict-not-disjoint-literal-and-func
[10:25:04] [PASSED] conflict-reg-type
[10:25:04] [PASSED] bad-mcr-reg-forced-to-regular
[10:25:04] [PASSED] bad-regular-reg-forced-to-mcr
[10:25:04] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[10:25:04] ================== xe_rtp_process_tests  ===================
[10:25:04] [PASSED] active1
[10:25:04] [PASSED] active2
[10:25:04] [PASSED] active-inactive
[10:25:04] [PASSED] inactive-active
[10:25:04] [PASSED] inactive-active-inactive
[10:25:04] [PASSED] inactive-inactive-inactive
[10:25:04] ============== [PASSED] xe_rtp_process_tests ===============
[10:25:04] ===================== [PASSED] xe_rtp ======================
[10:25:04] ==================== xe_wa (1 subtest) =====================
[10:25:04] ======================== xe_wa_gt  =========================
[10:25:04] [PASSED] TIGERLAKE B0
[10:25:04] [PASSED] DG1 A0
[10:25:04] [PASSED] DG1 B0
[10:25:04] [PASSED] ALDERLAKE_S A0
[10:25:04] [PASSED] ALDERLAKE_S B0
[10:25:04] [PASSED] ALDERLAKE_S C0
[10:25:04] [PASSED] ALDERLAKE_S D0
[10:25:04] [PASSED] ALDERLAKE_P A0
[10:25:04] [PASSED] ALDERLAKE_P B0
[10:25:04] [PASSED] ALDERLAKE_P C0
[10:25:04] [PASSED] ALDERLAKE_S RPLS D0
[10:25:04] [PASSED] ALDERLAKE_P RPLU E0
[10:25:04] [PASSED] DG2 G10 C0
[10:25:04] [PASSED] DG2 G11 B1
[10:25:04] [PASSED] DG2 G12 A1
[10:25:04] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[10:25:04] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[10:25:04] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[10:25:04] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[10:25:04] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[10:25:04] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[10:25:04] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[10:25:04] ==================== [PASSED] xe_wa_gt =====================
[10:25:04] ====================== [PASSED] xe_wa ======================
[10:25:04] ============================================================
[10:25:04] Testing complete. Ran 789 tests: passed: 761, skipped: 28
[10:25:04] Elapsed time: 37.688s total, 4.359s configuring, 32.612s building, 0.684s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig [10:25:05] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[10:25:06] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[10:25:32] Starting KUnit Kernel (1/1)...
[10:25:32] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[10:25:32] ============ drm_test_pick_cmdline (2 subtests) ============
[10:25:32] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[10:25:32] =============== drm_test_pick_cmdline_named  ===============
[10:25:32] [PASSED] NTSC
[10:25:32] [PASSED] NTSC-J
[10:25:32] [PASSED] PAL
[10:25:32] [PASSED] PAL-M
[10:25:32] =========== [PASSED] drm_test_pick_cmdline_named ===========
[10:25:32] ============== [PASSED] drm_test_pick_cmdline ==============
[10:25:32] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[10:25:32] [PASSED] drm_test_drm_atomic_get_connector_for_encoder
[10:25:32] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ====
[10:25:32] =========== drm_validate_clone_mode (2 subtests) ===========
[10:25:32] ============== drm_test_check_in_clone_mode  ===============
[10:25:32] [PASSED] in_clone_mode
[10:25:32] [PASSED] not_in_clone_mode
[10:25:32] ========== [PASSED] drm_test_check_in_clone_mode ===========
[10:25:32] =============== drm_test_check_valid_clones  ===============
[10:25:32] [PASSED] not_in_clone_mode
[10:25:32] [PASSED] valid_clone
[10:25:32] [PASSED] invalid_clone
[10:25:32] =========== [PASSED] drm_test_check_valid_clones ===========
[10:25:32] ============= [PASSED] drm_validate_clone_mode =============
[10:25:32] ============= drm_validate_modeset (1 subtest) =============
[10:25:32] [PASSED] drm_test_check_connector_changed_modeset
[10:25:32] ============== [PASSED] drm_validate_modeset ===============
[10:25:32] ====== drm_test_bridge_get_current_state (1 subtest) =======
[10:25:32] [PASSED] drm_test_drm_bridge_get_current_state_atomic
[10:25:32] ======== [PASSED] drm_test_bridge_get_current_state ========
[10:25:32] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ======
[10:25:32] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic
[10:25:32] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled
[10:25:32] [PASSED] drm_test_drm_bridge_helper_hdmi_output_bus_fmts
[10:25:32] ======== [PASSED] drm_test_bridge_helper_reset_crtc ========
[10:25:32] ============== drm_bridge_alloc (2 subtests) ===============
[10:25:32] [PASSED] drm_test_drm_bridge_alloc_basic
[10:25:32] [PASSED] drm_test_drm_bridge_alloc_get_put
[10:25:32] ================ [PASSED] drm_bridge_alloc =================
[10:25:32] ============= drm_bridge_bus_fmt (5 subtests) ==============
[10:25:32] [PASSED] drm_test_bridge_rgb_yuv_rgb
[10:25:32] [PASSED] drm_test_bridge_must_convert_to_yuv444
[10:25:32] [PASSED] drm_test_bridge_hdmi_auto_rgb
[10:25:32] [PASSED] drm_test_bridge_auto_first
[10:25:32] [PASSED] drm_test_bridge_rgb_yuv_no_path
[10:25:32] =============== [PASSED] drm_bridge_bus_fmt ================
[10:25:32] ============= drm_cmdline_parser (40 subtests) =============
[10:25:32] [PASSED] drm_test_cmdline_force_d_only
[10:25:32] [PASSED] drm_test_cmdline_force_D_only_dvi
[10:25:32] [PASSED] drm_test_cmdline_force_D_only_hdmi
[10:25:32] [PASSED] drm_test_cmdline_force_D_only_not_digital
[10:25:32] [PASSED] drm_test_cmdline_force_e_only
[10:25:32] [PASSED] drm_test_cmdline_res
[10:25:32] [PASSED] drm_test_cmdline_res_vesa
[10:25:32] [PASSED] drm_test_cmdline_res_vesa_rblank
[10:25:32] [PASSED] drm_test_cmdline_res_rblank
[10:25:32] [PASSED] drm_test_cmdline_res_bpp
[10:25:32] [PASSED] drm_test_cmdline_res_refresh
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[10:25:32] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[10:25:32] [PASSED] drm_test_cmdline_res_margins_force_on
[10:25:32] [PASSED] drm_test_cmdline_res_vesa_margins
[10:25:32] [PASSED] drm_test_cmdline_name
[10:25:32] [PASSED] drm_test_cmdline_name_bpp
[10:25:32] [PASSED] drm_test_cmdline_name_option
[10:25:32] [PASSED] drm_test_cmdline_name_bpp_option
[10:25:32] [PASSED] drm_test_cmdline_rotate_0
[10:25:32] [PASSED] drm_test_cmdline_rotate_90
[10:25:32] [PASSED] drm_test_cmdline_rotate_180
[10:25:32] [PASSED] drm_test_cmdline_rotate_270
[10:25:32] [PASSED] drm_test_cmdline_hmirror
[10:25:32] [PASSED] drm_test_cmdline_vmirror
[10:25:32] [PASSED] drm_test_cmdline_margin_options
[10:25:32] [PASSED] drm_test_cmdline_multiple_options
[10:25:32] [PASSED] drm_test_cmdline_bpp_extra_and_option
[10:25:32] [PASSED] drm_test_cmdline_extra_and_option
[10:25:32] [PASSED] drm_test_cmdline_freestanding_options
[10:25:32] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[10:25:32] [PASSED] drm_test_cmdline_panel_orientation
[10:25:32] ================ drm_test_cmdline_invalid  =================
[10:25:32] [PASSED] margin_only
[10:25:32] [PASSED] interlace_only
[10:25:32] [PASSED] res_missing_x
[10:25:32] [PASSED] res_missing_y
[10:25:32] [PASSED] res_bad_y
[10:25:32] [PASSED] res_missing_y_bpp
[10:25:32] [PASSED] res_bad_bpp
[10:25:32] [PASSED] res_bad_refresh
[10:25:32] [PASSED] res_bpp_refresh_force_on_off
[10:25:32] [PASSED] res_invalid_mode
[10:25:32] [PASSED] res_bpp_wrong_place_mode
[10:25:32] [PASSED] name_bpp_refresh
[10:25:32] [PASSED] name_refresh
[10:25:32] [PASSED] name_refresh_wrong_mode
[10:25:32] [PASSED] name_refresh_invalid_mode
[10:25:32] [PASSED] rotate_multiple
[10:25:32] [PASSED] rotate_invalid_val
[10:25:32] [PASSED] rotate_truncated
[10:25:32] [PASSED] invalid_option
[10:25:32] [PASSED] invalid_tv_option
[10:25:32] [PASSED] truncated_tv_option
[10:25:32] ============ [PASSED] drm_test_cmdline_invalid =============
[10:25:32] =============== drm_test_cmdline_tv_options  ===============
[10:25:32] [PASSED] NTSC
[10:25:32] [PASSED] NTSC_443
[10:25:32] [PASSED] NTSC_J
[10:25:32] [PASSED] PAL
[10:25:32] [PASSED] PAL_M
[10:25:32] [PASSED] PAL_N
[10:25:32] [PASSED] SECAM
[10:25:32] [PASSED] MONO_525
[10:25:32] [PASSED] MONO_625
[10:25:32] =========== [PASSED] drm_test_cmdline_tv_options ===========
[10:25:32] =============== [PASSED] drm_cmdline_parser ================
[10:25:32] ========== drmm_connector_hdmi_init (20 subtests) ==========
[10:25:32] [PASSED] drm_test_connector_hdmi_init_valid
[10:25:32] [PASSED] drm_test_connector_hdmi_init_bpc_8
[10:25:32] [PASSED] drm_test_connector_hdmi_init_bpc_10
[10:25:32] [PASSED] drm_test_connector_hdmi_init_bpc_12
[10:25:32] [PASSED] drm_test_connector_hdmi_init_bpc_invalid
[10:25:32] [PASSED] drm_test_connector_hdmi_init_bpc_null
[10:25:32] [PASSED] drm_test_connector_hdmi_init_formats_empty
[10:25:32] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb
[10:25:32] === drm_test_connector_hdmi_init_formats_yuv420_allowed  ===
[10:25:32] [PASSED] supported_formats=0x9 yuv420_allowed=1
[10:25:32] [PASSED] supported_formats=0x9 yuv420_allowed=0
[10:25:32] [PASSED] supported_formats=0x5 yuv420_allowed=1
[10:25:32] [PASSED] supported_formats=0x5 yuv420_allowed=0
[10:25:32] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[10:25:32] [PASSED] drm_test_connector_hdmi_init_null_ddc
[10:25:32] [PASSED] drm_test_connector_hdmi_init_null_product
[10:25:32] [PASSED] drm_test_connector_hdmi_init_null_vendor
[10:25:32] [PASSED] drm_test_connector_hdmi_init_product_length_exact
[10:25:32] [PASSED] drm_test_connector_hdmi_init_product_length_too_long
[10:25:32] [PASSED] drm_test_connector_hdmi_init_product_valid
[10:25:32] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact
[10:25:32] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long
[10:25:32] [PASSED] drm_test_connector_hdmi_init_vendor_valid
[10:25:32] ========= drm_test_connector_hdmi_init_type_valid  =========
[10:25:32] [PASSED] HDMI-A
[10:25:32] [PASSED] HDMI-B
[10:25:32] ===== [PASSED] drm_test_connector_hdmi_init_type_valid =====
[10:25:32] ======== drm_test_connector_hdmi_init_type_invalid  ========
[10:25:32] [PASSED] Unknown
[10:25:32] [PASSED] VGA
[10:25:32] [PASSED] DVI-I
[10:25:32] [PASSED] DVI-D
[10:25:32] [PASSED] DVI-A
[10:25:32] [PASSED] Composite
[10:25:32] [PASSED] SVIDEO
[10:25:32] [PASSED] LVDS
[10:25:32] [PASSED] Component
[10:25:32] [PASSED] DIN
[10:25:32] [PASSED] DP
[10:25:32] [PASSED] TV
[10:25:32] [PASSED] eDP
[10:25:32] [PASSED] Virtual
[10:25:32] [PASSED] DSI
[10:25:32] [PASSED] DPI
[10:25:32] [PASSED] Writeback
[10:25:32] [PASSED] SPI
[10:25:32] [PASSED] USB
[10:25:32] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ====
[10:25:32] ============ [PASSED] drmm_connector_hdmi_init =============
[10:25:32] ============= drmm_connector_init (3 subtests) =============
[10:25:32] [PASSED] drm_test_drmm_connector_init
[10:25:32] [PASSED] drm_test_drmm_connector_init_null_ddc
[10:25:32] ========= drm_test_drmm_connector_init_type_valid  =========
[10:25:32] [PASSED] Unknown
[10:25:32] [PASSED] VGA
[10:25:32] [PASSED] DVI-I
[10:25:32] [PASSED] DVI-D
[10:25:32] [PASSED] DVI-A
[10:25:32] [PASSED] Composite
[10:25:32] [PASSED] SVIDEO
[10:25:32] [PASSED] LVDS
[10:25:32] [PASSED] Component
[10:25:32] [PASSED] DIN
[10:25:32] [PASSED] DP
[10:25:32] [PASSED] HDMI-A
[10:25:32] [PASSED] HDMI-B
[10:25:32] [PASSED] TV
[10:25:32] [PASSED] eDP
[10:25:32] [PASSED] Virtual
[10:25:32] [PASSED] DSI
[10:25:32] [PASSED] DPI
[10:25:32] [PASSED] Writeback
[10:25:32] [PASSED] SPI
[10:25:32] [PASSED] USB
[10:25:32] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[10:25:32] =============== [PASSED] drmm_connector_init ===============
[10:25:32] ========= drm_connector_dynamic_init (6 subtests) ==========
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_init
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_init_not_added
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_init_properties
[10:25:32] ===== drm_test_drm_connector_dynamic_init_type_valid  ======
[10:25:32] [PASSED] Unknown
[10:25:32] [PASSED] VGA
[10:25:32] [PASSED] DVI-I
[10:25:32] [PASSED] DVI-D
[10:25:32] [PASSED] DVI-A
[10:25:32] [PASSED] Composite
[10:25:32] [PASSED] SVIDEO
[10:25:32] [PASSED] LVDS
[10:25:32] [PASSED] Component
[10:25:32] [PASSED] DIN
[10:25:32] [PASSED] DP
[10:25:32] [PASSED] HDMI-A
[10:25:32] [PASSED] HDMI-B
[10:25:32] [PASSED] TV
[10:25:32] [PASSED] eDP
[10:25:32] [PASSED] Virtual
[10:25:32] [PASSED] DSI
[10:25:32] [PASSED] DPI
[10:25:32] [PASSED] Writeback
[10:25:32] [PASSED] SPI
[10:25:32] [PASSED] USB
[10:25:32] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid ==
[10:25:32] ======== drm_test_drm_connector_dynamic_init_name  =========
[10:25:32] [PASSED] Unknown
[10:25:32] [PASSED] VGA
[10:25:32] [PASSED] DVI-I
[10:25:32] [PASSED] DVI-D
[10:25:32] [PASSED] DVI-A
[10:25:32] [PASSED] Composite
[10:25:32] [PASSED] SVIDEO
[10:25:32] [PASSED] LVDS
[10:25:32] [PASSED] Component
[10:25:32] [PASSED] DIN
[10:25:32] [PASSED] DP
[10:25:32] [PASSED] HDMI-A
[10:25:32] [PASSED] HDMI-B
[10:25:32] [PASSED] TV
[10:25:32] [PASSED] eDP
[10:25:32] [PASSED] Virtual
[10:25:32] [PASSED] DSI
[10:25:32] [PASSED] DPI
[10:25:32] [PASSED] Writeback
[10:25:32] [PASSED] SPI
[10:25:32] [PASSED] USB
[10:25:32] ==== [PASSED] drm_test_drm_connector_dynamic_init_name =====
[10:25:32] =========== [PASSED] drm_connector_dynamic_init ============
[10:25:32] ==== drm_connector_dynamic_register_early (4 subtests) =====
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_early_defer
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object
[10:25:32] ====== [PASSED] drm_connector_dynamic_register_early =======
[10:25:32] ======= drm_connector_dynamic_register (7 subtests) ========
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_on_list
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_no_defer
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_no_init
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_mode_object
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_sysfs
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name
[10:25:32] [PASSED] drm_test_drm_connector_dynamic_register_debugfs
[10:25:32] ========= [PASSED] drm_connector_dynamic_register ==========
[10:25:32] = drm_connector_attach_broadcast_rgb_property (2 subtests) =
[10:25:32] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property
[10:25:32] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector
[10:25:32] === [PASSED] drm_connector_attach_broadcast_rgb_property ===
[10:25:32] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[10:25:32] ========== drm_test_get_tv_mode_from_name_valid  ===========
[10:25:32] [PASSED] NTSC
[10:25:32] [PASSED] NTSC-443
[10:25:32] [PASSED] NTSC-J
[10:25:32] [PASSED] PAL
[10:25:32] [PASSED] PAL-M
[10:25:32] [PASSED] PAL-N
[10:25:32] [PASSED] SECAM
[10:25:32] [PASSED] Mono
[10:25:32] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[10:25:32] [PASSED] drm_test_get_tv_mode_from_name_truncated
[10:25:32] ============ [PASSED] drm_get_tv_mode_from_name ============
[10:25:32] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) =
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1
[10:25:32] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double
[10:25:32] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid  =
[10:25:32] [PASSED] VIC 96
[10:25:32] [PASSED] VIC 97
[10:25:32] [PASSED] VIC 101
[10:25:32] [PASSED] VIC 102
[10:25:32] [PASSED] VIC 106
[10:25:32] [PASSED] VIC 107
[10:25:32] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid ===
[10:25:32] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc
[10:25:32] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc
[10:25:32] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc
[10:25:32] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc
[10:25:32] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc
[10:25:32] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ====
[10:25:32] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) ==
[10:25:32] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name  ====
[10:25:32] [PASSED] Automatic
[10:25:32] [PASSED] Full
[10:25:32] [PASSED] Limited 16:235
[10:25:32] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name ===
[10:25:32] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid
[10:25:32] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ====
[10:25:32] == drm_hdmi_connector_get_output_format_name (2 subtests) ==
[10:25:32] === drm_test_drm_hdmi_connector_get_output_format_name  ====
[10:25:32] [PASSED] RGB
[10:25:32] [PASSED] YUV 4:2:0
[10:25:32] [PASSED] YUV 4:2:2
[10:25:32] [PASSED] YUV 4:4:4
[10:25:32] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name ===
[10:25:32] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid
[10:25:32] ==== [PASSED] drm_hdmi_connector_get_output_format_name ====
[10:25:32] ============= drm_damage_helper (21 subtests) ==============
[10:25:32] [PASSED] drm_test_damage_iter_no_damage
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_src_moved
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_not_visible
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[10:25:32] [PASSED] drm_test_damage_iter_no_damage_no_fb
[10:25:32] [PASSED] drm_test_damage_iter_simple_damage
[10:25:32] [PASSED] drm_test_damage_iter_single_damage
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_outside_src
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_src_moved
[10:25:32] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[10:25:32] [PASSED] drm_test_damage_iter_damage
[10:25:32] [PASSED] drm_test_damage_iter_damage_one_intersect
[10:25:32] [PASSED] drm_test_damage_iter_damage_one_outside
[10:25:32] [PASSED] drm_test_damage_iter_damage_src_moved
[10:25:32] [PASSED] drm_test_damage_iter_damage_not_visible
[10:25:32] ================ [PASSED] drm_damage_helper ================
[10:25:32] ============== drm_dp_mst_helper (3 subtests) ==============
[10:25:32] ============== drm_test_dp_mst_calc_pbn_mode  ==============
[10:25:32] [PASSED] Clock 154000 BPP 30 DSC disabled
[10:25:32] [PASSED] Clock 234000 BPP 30 DSC disabled
[10:25:32] [PASSED] Clock 297000 BPP 24 DSC disabled
[10:25:32] [PASSED] Clock 332880 BPP 24 DSC enabled
[10:25:32] [PASSED] Clock 324540 BPP 24 DSC enabled
[10:25:32] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[10:25:32] ============== drm_test_dp_mst_calc_pbn_div  ===============
[10:25:32] [PASSED] Link rate 2000000 lane count 4
[10:25:32] [PASSED] Link rate 2000000 lane count 2
[10:25:32] [PASSED] Link rate 2000000 lane count 1
[10:25:32] [PASSED] Link rate 1350000 lane count 4
[10:25:32] [PASSED] Link rate 1350000 lane count 2
[10:25:32] [PASSED] Link rate 1350000 lane count 1
[10:25:32] [PASSED] Link rate 1000000 lane count 4
[10:25:32] [PASSED] Link rate 1000000 lane count 2
[10:25:32] [PASSED] Link rate 1000000 lane count 1
[10:25:32] [PASSED] Link rate 810000 lane count 4
[10:25:32] [PASSED] Link rate 810000 lane count 2
[10:25:32] [PASSED] Link rate 810000 lane count 1
[10:25:32] [PASSED] Link rate 540000 lane count 4
[10:25:32] [PASSED] Link rate 540000 lane count 2
[10:25:32] [PASSED] Link rate 540000 lane count 1
[10:25:32] [PASSED] Link rate 270000 lane count 4
[10:25:32] [PASSED] Link rate 270000 lane count 2
[10:25:32] [PASSED] Link rate 270000 lane count 1
[10:25:32] [PASSED] Link rate 162000 lane count 4
[10:25:32] [PASSED] Link rate 162000 lane count 2
[10:25:32] [PASSED] Link rate 162000 lane count 1
[10:25:32] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[10:25:32] ========= drm_test_dp_mst_sideband_msg_req_decode  =========
[10:25:32] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[10:25:32] [PASSED] DP_POWER_UP_PHY with port number
[10:25:32] [PASSED] DP_POWER_DOWN_PHY with port number
[10:25:32] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[10:25:32] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[10:25:32] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[10:25:32] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[10:25:32] [PASSED] DP_QUERY_PAYLOAD with port number
[10:25:32] [PASSED] DP_QUERY_PAYLOAD with VCPI
[10:25:32] [PASSED] DP_REMOTE_DPCD_READ with port number
[10:25:32] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[10:25:32] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[10:25:32] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[10:25:32] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[10:25:32] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[10:25:32] [PASSED] DP_REMOTE_I2C_READ with port number
[10:25:32] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[10:25:32] [PASSED] DP_REMOTE_I2C_READ with transactions array
[10:25:32] [PASSED] DP_REMOTE_I2C_WRITE with port number
[10:25:32] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[10:25:32] [PASSED] DP_REMOTE_I2C_WRITE with data array
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[10:25:32] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[10:25:32] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[10:25:32] ================ [PASSED] drm_dp_mst_helper ================
[10:25:32] ================== drm_exec (7 subtests) ===================
[10:25:32] [PASSED] sanitycheck
[10:25:32] [PASSED] test_lock
[10:25:32] [PASSED] test_lock_unlock
[10:25:32] [PASSED] test_duplicates
[10:25:32] [PASSED] test_prepare
[10:25:32] [PASSED] test_prepare_array
[10:25:32] [PASSED] test_multiple_loops
[10:25:32] ==================== [PASSED] drm_exec =====================
[10:25:32] =========== drm_format_helper_test (17 subtests) ===========
[10:25:32] ============== drm_test_fb_xrgb8888_to_gray8  ==============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[10:25:32] ============= drm_test_fb_xrgb8888_to_rgb332  ==============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[10:25:32] ============= drm_test_fb_xrgb8888_to_rgb565  ==============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[10:25:32] ============ drm_test_fb_xrgb8888_to_xrgb1555  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[10:25:32] ============ drm_test_fb_xrgb8888_to_argb1555  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[10:25:32] ============ drm_test_fb_xrgb8888_to_rgba5551  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[10:25:32] ============= drm_test_fb_xrgb8888_to_rgb888  ==============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[10:25:32] ============= drm_test_fb_xrgb8888_to_bgr888  ==============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ==========
[10:25:32] ============ drm_test_fb_xrgb8888_to_argb8888  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[10:25:32] =========== drm_test_fb_xrgb8888_to_xrgb2101010  ===========
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[10:25:32] =========== drm_test_fb_xrgb8888_to_argb2101010  ===========
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[10:25:32] ============== drm_test_fb_xrgb8888_to_mono  ===============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[10:25:32] ==================== drm_test_fb_swab  =====================
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ================ [PASSED] drm_test_fb_swab =================
[10:25:32] ============ drm_test_fb_xrgb8888_to_xbgr8888  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[10:25:32] ============ drm_test_fb_xrgb8888_to_abgr8888  =============
[10:25:32] [PASSED] single_pixel_source_buffer
[10:25:32] [PASSED] single_pixel_clip_rectangle
[10:25:32] [PASSED] well_known_colors
[10:25:32] [PASSED] destination_pitch
[10:25:32] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[10:25:32] ================= drm_test_fb_clip_offset  =================
[10:25:32] [PASSED] pass through
[10:25:32] [PASSED] horizontal offset
[10:25:32] [PASSED] vertical offset
[10:25:32] [PASSED] horizontal and vertical offset
[10:25:32] [PASSED] horizontal offset (custom pitch)
[10:25:32] [PASSED] vertical offset (custom pitch)
[10:25:32] [PASSED] horizontal and vertical offset (custom pitch)
[10:25:32] ============= [PASSED] drm_test_fb_clip_offset =============
[10:25:32] =================== drm_test_fb_memcpy  ====================
[10:25:32] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[10:25:32] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[10:25:32] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[10:25:32] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[10:25:32] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[10:25:32] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[10:25:32] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[10:25:32] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[10:25:32] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[10:25:32] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[10:25:32] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[10:25:32] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[10:25:32] =============== [PASSED] drm_test_fb_memcpy ================
[10:25:32] ============= [PASSED] drm_format_helper_test ==============
[10:25:32] ================= drm_format (18 subtests) =================
[10:25:32] [PASSED] drm_test_format_block_width_invalid
[10:25:32] [PASSED] drm_test_format_block_width_one_plane
[10:25:32] [PASSED] drm_test_format_block_width_two_plane
[10:25:32] [PASSED] drm_test_format_block_width_three_plane
[10:25:32] [PASSED] drm_test_format_block_width_tiled
[10:25:32] [PASSED] drm_test_format_block_height_invalid
[10:25:32] [PASSED] drm_test_format_block_height_one_plane
[10:25:32] [PASSED] drm_test_format_block_height_two_plane
[10:25:32] [PASSED] drm_test_format_block_height_three_plane
[10:25:32] [PASSED] drm_test_format_block_height_tiled
[10:25:32] [PASSED] drm_test_format_min_pitch_invalid
[10:25:32] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[10:25:32] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[10:25:32] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[10:25:32] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[10:25:32] [PASSED] drm_test_format_min_pitch_two_plane
[10:25:32] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[10:25:32] [PASSED] drm_test_format_min_pitch_tiled
[10:25:32] =================== [PASSED] drm_format ====================
[10:25:32] ============== drm_framebuffer (10 subtests) ===============
[10:25:32] ========== drm_test_framebuffer_check_src_coords  ==========
[10:25:32] [PASSED] Success: source fits into fb
[10:25:32] [PASSED] Fail: overflowing fb with x-axis coordinate
[10:25:32] [PASSED] Fail: overflowing fb with y-axis coordinate
[10:25:32] [PASSED] Fail: overflowing fb with source width
[10:25:32] [PASSED] Fail: overflowing fb with source height
[10:25:32] ====== [PASSED] drm_test_framebuffer_check_src_coords ======
[10:25:32] [PASSED] drm_test_framebuffer_cleanup
[10:25:32] =============== drm_test_framebuffer_create  ===============
[10:25:32] [PASSED] ABGR8888 normal sizes
[10:25:32] [PASSED] ABGR8888 max sizes
[10:25:32] [PASSED] ABGR8888 pitch greater than min required
[10:25:32] [PASSED] ABGR8888 pitch less than min required
[10:25:32] [PASSED] ABGR8888 Invalid width
[10:25:32] [PASSED] ABGR8888 Invalid buffer handle
[10:25:32] [PASSED] No pixel format
[10:25:32] [PASSED] ABGR8888 Width 0
[10:25:32] [PASSED] ABGR8888 Height 0
[10:25:32] [PASSED] ABGR8888 Out of bound height * pitch combination
[10:25:32] [PASSED] ABGR8888 Large buffer offset
[10:25:32] [PASSED] ABGR8888 Buffer offset for inexistent plane
[10:25:32] [PASSED] ABGR8888 Invalid flag
[10:25:32] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[10:25:32] [PASSED] ABGR8888 Valid buffer modifier
[10:25:32] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[10:25:32] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] NV12 Normal sizes
[10:25:32] [PASSED] NV12 Max sizes
[10:25:32] [PASSED] NV12 Invalid pitch
[10:25:32] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[10:25:32] [PASSED] NV12 different  modifier per-plane
[10:25:32] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[10:25:32] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] NV12 Modifier for inexistent plane
[10:25:32] [PASSED] NV12 Handle for inexistent plane
[10:25:32] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[10:25:32] [PASSED] YVU420 Normal sizes
[10:25:32] [PASSED] YVU420 Max sizes
[10:25:32] [PASSED] YVU420 Invalid pitch
[10:25:32] [PASSED] YVU420 Different pitches
[10:25:32] [PASSED] YVU420 Different buffer offsets/pitches
[10:25:32] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[10:25:32] [PASSED] YVU420 Valid modifier
[10:25:32] [PASSED] YVU420 Different modifiers per plane
[10:25:32] [PASSED] YVU420 Modifier for inexistent plane
[10:25:32] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)
[10:25:32] [PASSED] X0L2 Normal sizes
[10:25:32] [PASSED] X0L2 Max sizes
[10:25:32] [PASSED] X0L2 Invalid pitch
[10:25:32] [PASSED] X0L2 Pitch greater than minimum required
[10:25:32] [PASSED] X0L2 Handle for inexistent plane
[10:25:32] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[10:25:32] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[10:25:32] [PASSED] X0L2 Valid modifier
[10:25:32] [PASSED] X0L2 Modifier for inexistent plane
[10:25:32] =========== [PASSED] drm_test_framebuffer_create ===========
[10:25:32] [PASSED] drm_test_framebuffer_free
[10:25:32] [PASSED] drm_test_framebuffer_init
[10:25:32] [PASSED] drm_test_framebuffer_init_bad_format
[10:25:32] [PASSED] drm_test_framebuffer_init_dev_mismatch
[10:25:32] [PASSED] drm_test_framebuffer_lookup
[10:25:32] [PASSED] drm_test_framebuffer_lookup_inexistent
[10:25:32] [PASSED] drm_test_framebuffer_modifiers_not_supported
[10:25:32] ================= [PASSED] drm_framebuffer =================
[10:25:32] ================ drm_gem_shmem (8 subtests) ================
[10:25:32] [PASSED] drm_gem_shmem_test_obj_create
[10:25:32] [PASSED] drm_gem_shmem_test_obj_create_private
[10:25:32] [PASSED] drm_gem_shmem_test_pin_pages
[10:25:32] [PASSED] drm_gem_shmem_test_vmap
[10:25:32] [PASSED] drm_gem_shmem_test_get_sg_table
[10:25:32] [PASSED] drm_gem_shmem_test_get_pages_sgt
[10:25:32] [PASSED] drm_gem_shmem_test_madvise
[10:25:32] [PASSED] drm_gem_shmem_test_purge
[10:25:32] ================== [PASSED] drm_gem_shmem ==================
[10:25:32] === drm_atomic_helper_connector_hdmi_check (29 subtests) ===
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1
[10:25:32] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420  =======
[10:25:32] [PASSED] Automatic
[10:25:32] [PASSED] Full
[10:25:32] [PASSED] Limited 16:235
[10:25:32] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 ===
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed
[10:25:32] [PASSED] drm_test_check_disable_connector
[10:25:32] [PASSED] drm_test_check_hdmi_funcs_reject_rate
[10:25:32] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb
[10:25:32] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420
[10:25:32] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422
[10:25:32] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420
[10:25:32] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420
[10:25:32] [PASSED] drm_test_check_output_bpc_crtc_mode_changed
[10:25:32] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed
[10:25:32] [PASSED] drm_test_check_output_bpc_dvi
[10:25:32] [PASSED] drm_test_check_output_bpc_format_vic_1
[10:25:32] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only
[10:25:32] [PASSED] drm_test_check_output_bpc_format_display_rgb_only
[10:25:32] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only
[10:25:32] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only
[10:25:32] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc
[10:25:32] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc
[10:25:32] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc
[10:25:32] ============ drm_test_check_hdmi_color_format  =============
[10:25:32] [PASSED] AUTO -> RGB
[10:25:32] [PASSED] YCBCR422 -> YUV422
[10:25:32] [PASSED] YCBCR420 -> YUV420
[10:25:32] [PASSED] YCBCR444 -> YUV444
[10:25:32] [PASSED] RGB -> RGB
[10:25:32] ======== [PASSED] drm_test_check_hdmi_color_format =========
[10:25:32] ======== drm_test_check_hdmi_color_format_420_only  ========
[10:25:32] [PASSED] RGB should fail
[10:25:32] [PASSED] YUV444 should fail
[10:25:32] [PASSED] YUV422 should fail
[10:25:32] [PASSED] YUV420 should work
[10:25:32] ==== [PASSED] drm_test_check_hdmi_color_format_420_only ====
[10:25:32] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ======
[10:25:32] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ====
[10:25:32] [PASSED] drm_test_check_broadcast_rgb_value
[10:25:32] [PASSED] drm_test_check_bpc_8_value
[10:25:32] [PASSED] drm_test_check_bpc_10_value
[10:25:32] [PASSED] drm_test_check_bpc_12_value
[10:25:32] [PASSED] drm_test_check_format_value
[10:25:32] [PASSED] drm_test_check_tmds_char_value
[10:25:32] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ======
[10:25:32] = drm_atomic_helper_connector_hdmi_mode_valid (7 subtests) =
[10:25:32] [PASSED] drm_test_check_mode_valid
[10:25:32] [PASSED] drm_test_check_mode_valid_reject
[10:25:32] [PASSED] drm_test_check_mode_valid_reject_rate
[10:25:32] [PASSED] drm_test_check_mode_valid_reject_max_clock
[10:25:32] [PASSED] drm_test_check_mode_valid_yuv420_only_max_clock
[10:25:32] [PASSED] drm_test_check_mode_valid_reject_yuv420_only_connector
[10:25:32] [PASSED] drm_test_check_mode_valid_accept_yuv420_also_connector_rgb
[10:25:32] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid ===
[10:25:32] = drm_atomic_helper_connector_hdmi_infoframes (5 subtests) =
[10:25:32] [PASSED] drm_test_check_infoframes
[10:25:32] [PASSED] drm_test_check_reject_avi_infoframe
[10:25:32] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_8
[10:25:32] [PASSED] drm_test_check_reject_hdr_infoframe_bpc_10
[10:25:32] [PASSED] drm_test_check_reject_audio_infoframe
[10:25:32] === [PASSED] drm_atomic_helper_connector_hdmi_infoframes ===
[10:25:32] ================= drm_managed (2 subtests) =================
[10:25:32] [PASSED] drm_test_managed_release_action
[10:25:32] [PASSED] drm_test_managed_run_action
[10:25:32] =================== [PASSED] drm_managed ===================
[10:25:32] =================== drm_mm (6 subtests) ====================
[10:25:32] [PASSED] drm_test_mm_init
[10:25:32] [PASSED] drm_test_mm_debug
[10:25:32] [PASSED] drm_test_mm_align32
[10:25:32] [PASSED] drm_test_mm_align64
[10:25:32] [PASSED] drm_test_mm_lowest
[10:25:32] [PASSED] drm_test_mm_highest
[10:25:32] ===================== [PASSED] drm_mm ======================
[10:25:32] ============= drm_modes_analog_tv (5 subtests) =============
[10:25:32] [PASSED] drm_test_modes_analog_tv_mono_576i
[10:25:32] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[10:25:32] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[10:25:32] [PASSED] drm_test_modes_analog_tv_pal_576i
[10:25:32] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[10:25:32] =============== [PASSED] drm_modes_analog_tv ===============
[10:25:32] ============== drm_plane_helper (2 subtests) ===============
[10:25:32] =============== drm_test_check_plane_state  ================
[10:25:32] [PASSED] clipping_simple
[10:25:32] [PASSED] clipping_rotate_reflect
[10:25:32] [PASSED] positioning_simple
[10:25:32] [PASSED] upscaling
[10:25:32] [PASSED] downscaling
[10:25:32] [PASSED] rounding1
[10:25:32] [PASSED] rounding2
[10:25:32] [PASSED] rounding3
[10:25:32] [PASSED] rounding4
[10:25:32] =========== [PASSED] drm_test_check_plane_state ============
[10:25:32] =========== drm_test_check_invalid_plane_state  ============
[10:25:32] [PASSED] positioning_invalid
[10:25:32] [PASSED] upscaling_invalid
[10:25:32] [PASSED] downscaling_invalid
[10:25:32] ======= [PASSED] drm_test_check_invalid_plane_state ========
[10:25:32] ================ [PASSED] drm_plane_helper =================
[10:25:32] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[10:25:32] ====== drm_test_connector_helper_tv_get_modes_check  =======
[10:25:32] [PASSED] None
[10:25:32] [PASSED] PAL
[10:25:32] [PASSED] NTSC
[10:25:32] [PASSED] Both, NTSC Default
[10:25:32] [PASSED] Both, PAL Default
[10:25:32] [PASSED] Both, NTSC Default, with PAL on command-line
[10:25:32] [PASSED] Both, PAL Default, with NTSC on command-line
[10:25:32] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[10:25:32] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[10:25:32] ================== drm_rect (9 subtests) ===================
[10:25:32] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[10:25:32] [PASSED] drm_test_rect_clip_scaled_not_clipped
[10:25:32] [PASSED] drm_test_rect_clip_scaled_clipped
[10:25:32] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[10:25:32] ================= drm_test_rect_intersect  =================
[10:25:32] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[10:25:32] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[10:25:32] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[10:25:32] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[10:25:32] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[10:25:32] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[10:25:32] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[10:25:32] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[10:25:32] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[10:25:32] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[10:25:32] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[10:25:32] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[10:25:32] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[10:25:32] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[10:25:32] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
[10:25:32] ============= [PASSED] drm_test_rect_intersect =============
[10:25:32] ================ drm_test_rect_calc_hscale  ================
[10:25:32] [PASSED] normal use
[10:25:32] [PASSED] out of max range
[10:25:32] [PASSED] out of min range
[10:25:32] [PASSED] zero dst
[10:25:32] [PASSED] negative src
[10:25:32] [PASSED] negative dst
[10:25:32] ============ [PASSED] drm_test_rect_calc_hscale ============
[10:25:32] ================ drm_test_rect_calc_vscale  ================
[10:25:32] [PASSED] normal use
[10:25:32] [PASSED] out of max range
[10:25:32] [PASSED] out of min range
[10:25:32] [PASSED] zero dst
[10:25:32] [PASSED] negative src
[10:25:32] [PASSED] negative dst
[10:25:32] ============ [PASSED] drm_test_rect_calc_vscale ============
[10:25:32] ================== drm_test_rect_rotate  ===================
[10:25:32] [PASSED] reflect-x
[10:25:32] [PASSED] reflect-y
[10:25:32] [PASSED] rotate-0
[10:25:32] [PASSED] rotate-90
[10:25:32] [PASSED] rotate-180
[10:25:32] [PASSED] rotate-270
[10:25:32] ============== [PASSED] drm_test_rect_rotate ===============
[10:25:32] ================ drm_test_rect_rotate_inv  =================
[10:25:32] [PASSED] reflect-x
[10:25:32] [PASSED] reflect-y
[10:25:32] [PASSED] rotate-0
[10:25:32] [PASSED] rotate-90
[10:25:32] [PASSED] rotate-180
[10:25:32] [PASSED] rotate-270
[10:25:32] ============ [PASSED] drm_test_rect_rotate_inv =============
[10:25:32] ==================== [PASSED] drm_rect =====================
[10:25:32] ============ drm_sysfb_modeset_test (1 subtest) ============
[10:25:32] ============ drm_test_sysfb_build_fourcc_list  =============
[10:25:32] [PASSED] no native formats
[10:25:32] [PASSED] XRGB8888 as native format
[10:25:32] [PASSED] remove duplicates
[10:25:32] [PASSED] convert alpha formats
[10:25:32] [PASSED] random formats
[10:25:32] ======== [PASSED] drm_test_sysfb_build_fourcc_list =========
[10:25:32] ============= [PASSED] drm_sysfb_modeset_test ==============
[10:25:32] ================== drm_fixp (2 subtests) ===================
[10:25:32] [PASSED] drm_test_int2fixp
[10:25:32] [PASSED] drm_test_sm2fixp
[10:25:32] ==================== [PASSED] drm_fixp =====================
[10:25:32] ============================================================
[10:25:32] Testing complete. Ran 637 tests: passed: 637
[10:25:32] Elapsed time: 27.255s total, 1.823s configuring, 25.267s building, 0.138s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig [10:25:32] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[10:25:34] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[10:25:44] Starting KUnit Kernel (1/1)...
[10:25:44] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[10:25:44] ================= ttm_device (5 subtests) ==================
[10:25:44] [PASSED] ttm_device_init_basic
[10:25:44] [PASSED] ttm_device_init_multiple
[10:25:44] [PASSED] ttm_device_fini_basic
[10:25:44] [PASSED] ttm_device_init_no_vma_man
[10:25:44] ================== ttm_device_init_pools  ==================
[10:25:44] [PASSED] No DMA allocations, no DMA32 required
[10:25:44] [PASSED] DMA allocations, DMA32 required
[10:25:44] [PASSED] No DMA allocations, DMA32 required
[10:25:44] [PASSED] DMA allocations, no DMA32 required
[10:25:44] ============== [PASSED] ttm_device_init_pools ==============
[10:25:44] =================== [PASSED] ttm_device ====================
[10:25:44] ================== ttm_pool (8 subtests) ===================
[10:25:44] ================== ttm_pool_alloc_basic  ===================
[10:25:44] [PASSED] One page
[10:25:44] [PASSED] More than one page
[10:25:44] [PASSED] Above the allocation limit
[10:25:44] [PASSED] One page, with coherent DMA mappings enabled
[10:25:44] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[10:25:44] ============== [PASSED] ttm_pool_alloc_basic ===============
[10:25:44] ============== ttm_pool_alloc_basic_dma_addr  ==============
[10:25:44] [PASSED] One page
[10:25:44] [PASSED] More than one page
[10:25:44] [PASSED] Above the allocation limit
[10:25:44] [PASSED] One page, with coherent DMA mappings enabled
[10:25:44] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[10:25:44] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[10:25:44] [PASSED] ttm_pool_alloc_order_caching_match
[10:25:44] [PASSED] ttm_pool_alloc_caching_mismatch
[10:25:44] [PASSED] ttm_pool_alloc_order_mismatch
[10:25:44] [PASSED] ttm_pool_free_dma_alloc
[10:25:44] [PASSED] ttm_pool_free_no_dma_alloc
[10:25:44] [PASSED] ttm_pool_fini_basic
[10:25:44] ==================== [PASSED] ttm_pool =====================
[10:25:44] ================ ttm_resource (8 subtests) =================
[10:25:44] ================= ttm_resource_init_basic  =================
[10:25:44] [PASSED] Init resource in TTM_PL_SYSTEM
[10:25:44] [PASSED] Init resource in TTM_PL_VRAM
[10:25:44] [PASSED] Init resource in a private placement
[10:25:44] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[10:25:44] ============= [PASSED] ttm_resource_init_basic =============
[10:25:44] [PASSED] ttm_resource_init_pinned
[10:25:44] [PASSED] ttm_resource_fini_basic
[10:25:44] [PASSED] ttm_resource_manager_init_basic
[10:25:44] [PASSED] ttm_resource_manager_usage_basic
[10:25:44] [PASSED] ttm_resource_manager_set_used_basic
[10:25:44] [PASSED] ttm_sys_man_alloc_basic
[10:25:44] [PASSED] ttm_sys_man_free_basic
[10:25:44] ================== [PASSED] ttm_resource ===================
[10:25:44] =================== ttm_tt (15 subtests) ===================
[10:25:44] ==================== ttm_tt_init_basic  ====================
[10:25:44] [PASSED] Page-aligned size
[10:25:44] [PASSED] Extra pages requested
[10:25:44] ================ [PASSED] ttm_tt_init_basic ================
[10:25:44] [PASSED] ttm_tt_init_misaligned
[10:25:44] [PASSED] ttm_tt_fini_basic
[10:25:44] [PASSED] ttm_tt_fini_sg
[10:25:44] [PASSED] ttm_tt_fini_shmem
[10:25:44] [PASSED] ttm_tt_create_basic
[10:25:44] [PASSED] ttm_tt_create_invalid_bo_type
[10:25:44] [PASSED] ttm_tt_create_ttm_exists
[10:25:44] [PASSED] ttm_tt_create_failed
[10:25:44] [PASSED] ttm_tt_destroy_basic
[10:25:44] [PASSED] ttm_tt_populate_null_ttm
[10:25:44] [PASSED] ttm_tt_populate_populated_ttm
[10:25:44] [PASSED] ttm_tt_unpopulate_basic
[10:25:44] [PASSED] ttm_tt_unpopulate_empty_ttm
[10:25:44] [PASSED] ttm_tt_swapin_basic
[10:25:44] ===================== [PASSED] ttm_tt ======================
[10:25:44] =================== ttm_bo (14 subtests) ===================
[10:25:44] =========== ttm_bo_reserve_optimistic_no_ticket  ===========
[10:25:44] [PASSED] Cannot be interrupted and sleeps
[10:25:44] [PASSED] Cannot be interrupted, locks straight away
[10:25:44] [PASSED] Can be interrupted, sleeps
[10:25:44] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[10:25:44] [PASSED] ttm_bo_reserve_locked_no_sleep
[10:25:44] [PASSED] ttm_bo_reserve_no_wait_ticket
[10:25:44] [PASSED] ttm_bo_reserve_double_resv
[10:25:44] [PASSED] ttm_bo_reserve_interrupted
[10:25:44] [PASSED] ttm_bo_reserve_deadlock
[10:25:44] [PASSED] ttm_bo_unreserve_basic
[10:25:44] [PASSED] ttm_bo_unreserve_pinned
[10:25:44] [PASSED] ttm_bo_unreserve_bulk
[10:25:44] [PASSED] ttm_bo_fini_basic
[10:25:44] [PASSED] ttm_bo_fini_shared_resv
[10:25:44] [PASSED] ttm_bo_pin_basic
[10:25:44] [PASSED] ttm_bo_pin_unpin_resource
[10:25:44] [PASSED] ttm_bo_multiple_pin_one_unpin
[10:25:44] ===================== [PASSED] ttm_bo ======================
[10:25:44] ============== ttm_bo_validate (22 subtests) ===============
[10:25:44] ============== ttm_bo_init_reserved_sys_man  ===============
[10:25:44] [PASSED] Buffer object for userspace
[10:25:44] [PASSED] Kernel buffer object
[10:25:44] [PASSED] Shared buffer object
[10:25:44] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[10:25:44] ============== ttm_bo_init_reserved_mock_man  ==============
[10:25:44] [PASSED] Buffer object for userspace
[10:25:44] [PASSED] Kernel buffer object
[10:25:44] [PASSED] Shared buffer object
[10:25:44] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[10:25:44] [PASSED] ttm_bo_init_reserved_resv
[10:25:44] ================== ttm_bo_validate_basic  ==================
[10:25:44] [PASSED] Buffer object for userspace
[10:25:44] [PASSED] Kernel buffer object
[10:25:44] [PASSED] Shared buffer object
[10:25:44] ============== [PASSED] ttm_bo_validate_basic ==============
[10:25:44] [PASSED] ttm_bo_validate_invalid_placement
[10:25:44] ============= ttm_bo_validate_same_placement  ==============
[10:25:44] [PASSED] System manager
[10:25:44] [PASSED] VRAM manager
[10:25:44] ========= [PASSED] ttm_bo_validate_same_placement ==========
[10:25:44] [PASSED] ttm_bo_validate_failed_alloc
[10:25:44] [PASSED] ttm_bo_validate_pinned
[10:25:44] [PASSED] ttm_bo_validate_busy_placement
[10:25:44] ================ ttm_bo_validate_multihop  =================
[10:25:44] [PASSED] Buffer object for userspace
[10:25:44] [PASSED] Kernel buffer object
[10:25:44] [PASSED] Shared buffer object
[10:25:44] ============ [PASSED] ttm_bo_validate_multihop =============
[10:25:44] ========== ttm_bo_validate_no_placement_signaled  ==========
[10:25:44] [PASSED] Buffer object in system domain, no page vector
[10:25:44] [PASSED] Buffer object in system domain with an existing page vector
[10:25:44] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[10:25:44] ======== ttm_bo_validate_no_placement_not_signaled  ========
[10:25:44] [PASSED] Buffer object for userspace
[10:25:44] [PASSED] Kernel buffer object
[10:25:44] [PASSED] Shared buffer object
[10:25:44] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[10:25:44] [PASSED] ttm_bo_validate_move_fence_signaled
[10:25:44] ========= ttm_bo_validate_move_fence_not_signaled  =========
[10:25:44] [PASSED] Waits for GPU
[10:25:44] [PASSED] Tries to lock straight away
[10:25:44] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[10:25:44] [PASSED] ttm_bo_validate_swapout
[10:25:44] [PASSED] ttm_bo_validate_happy_evict
[10:25:44] [PASSED] ttm_bo_validate_all_pinned_evict
[10:25:44] [PASSED] ttm_bo_validate_allowed_only_evict
[10:25:44] [PASSED] ttm_bo_validate_deleted_evict
[10:25:44] [PASSED] ttm_bo_validate_busy_domain_evict
[10:25:44] [PASSED] ttm_bo_validate_evict_gutting
[10:25:44] [PASSED] ttm_bo_validate_recrusive_evict
[10:25:44] ================= [PASSED] ttm_bo_validate =================
[10:25:44] ============================================================
[10:25:44] Testing complete. Ran 102 tests: passed: 102
[10:25:44] Elapsed time: 12.030s total, 1.820s configuring, 9.994s building, 0.180s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/dma-buf/.kunitconfig [10:25:44] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:

$ make ARCH=um O=.kunit olddefconfig
[10:25:46] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[10:25:55] Starting KUnit Kernel (1/1)...
[10:25:55] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[10:25:55] =============== dma-buf-fence (12 subtests) ================
[10:25:55] [PASSED] test_sanitycheck
[10:25:55] [PASSED] test_signaling
[10:25:55] [PASSED] test_add_callback
[10:25:55] [PASSED] test_late_add_callback
[10:25:55] [PASSED] test_rm_callback
[10:25:55] [PASSED] test_late_rm_callback
[10:25:55] [PASSED] test_status
[10:25:55] [PASSED] test_error
[10:25:55] [PASSED] test_wait
[10:25:55] [PASSED] test_wait_timeout
[10:25:55] [PASSED] test_stub
[10:25:55] [SKIPPED] test_race_signal_callback (requires at least 2 CPUs)
[10:25:55] ================== [PASSED] dma-buf-fence ==================
[10:25:55] ============ dma-buf-fence-chain (11 subtests) =============
[10:25:55] [PASSED] test_sanitycheck
[10:25:55] [PASSED] test_find_seqno
[10:25:55] [PASSED] test_find_signaled
[10:25:55] [PASSED] test_find_out_of_order
[10:26:00] [PASSED] test_find_gap
[10:26:00] [PASSED] test_find_race
[10:26:00] [PASSED] test_signal_forward
[10:26:00] [PASSED] test_signal_backward
[10:26:00] [PASSED] test_wait_forward
[10:26:00] [PASSED] test_wait_backward
[10:26:00] [PASSED] test_wait_random
[10:26:00] =============== [PASSED] dma-buf-fence-chain ===============
[10:26:00] ============ dma-buf-fence-unwrap (10 subtests) ============
[10:26:00] [PASSED] test_sanitycheck
[10:26:00] [PASSED] test_unwrap_array
[10:26:00] [PASSED] test_unwrap_chain
[10:26:00] [PASSED] test_unwrap_chain_array
[10:26:00] [PASSED] test_unwrap_merge
[10:26:00] [PASSED] test_unwrap_merge_duplicate
[10:26:00] [PASSED] test_unwrap_merge_seqno
[10:26:00] [PASSED] test_unwrap_merge_order
[10:26:00] [PASSED] test_unwrap_merge_complex
[10:26:00] [PASSED] test_unwrap_merge_complex_seqno
[10:26:00] ============== [PASSED] dma-buf-fence-unwrap ===============
[10:26:00] ================ dma-buf-resv (5 subtests) =================
[10:26:00] [PASSED] test_sanitycheck
[10:26:00] ===================== test_signaling  ======================
[10:26:00] [PASSED] kernel
[10:26:00] [PASSED] write
[10:26:00] [PASSED] read
[10:26:00] [PASSED] bookkeep
[10:26:00] ================= [PASSED] test_signaling ==================
[10:26:00] ====================== test_for_each  ======================
[10:26:00] [PASSED] kernel
[10:26:00] [PASSED] write
[10:26:00] [PASSED] read
[10:26:00] [PASSED] bookkeep
[10:26:00] ================== [PASSED] test_for_each ==================
[10:26:00] ================= test_for_each_unlocked  ==================
[10:26:00] [PASSED] kernel
[10:26:00] [PASSED] write
[10:26:00] [PASSED] read
[10:26:00] [PASSED] bookkeep
[10:26:00] ============= [PASSED] test_for_each_unlocked ==============
[10:26:00] ===================== test_get_fences  =====================
[10:26:00] [PASSED] kernel
[10:26:00] [PASSED] write
[10:26:00] [PASSED] read
[10:26:00] [PASSED] bookkeep
[10:26:00] ================= [PASSED] test_get_fences =================
[10:26:00] ================== [PASSED] dma-buf-resv ===================
[10:26:00] ============================================================
[10:26:00] Testing complete. Ran 50 tests: passed: 49, skipped: 1
[10:26:00] Elapsed time: 15.853s total, 1.818s configuring, 8.663s building, 5.359s running

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel

#48 lore raw

✓ Xe.CI.BAT: success for drm/xe: Isolate wedged devices from hardware access

In reply to Arvind Yadav
== Series Details ==

== Series Details ==

Series: drm/xe: Isolate wedged devices from hardware access
URL : https://patchwork.freedesktop.org/series/172860/
State : success

== Summary ==

CI Bug Log - changes from xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2_BAT -> xe-pw-172860v1_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (13 -> 13)
------------------------------

No changes in participating hosts

Changes
-------

No changes found

Build changes
-------------

* Linux: xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2 -> xe-pw-172860v1

IGT_9076: 8f42b0189d73d9912ad58c99cfaa4ff46c20fcc3 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2: 098021382451783ea6448fa7f0e2a4cbc395c3d2
xe-pw-172860v1: 172860v1

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/index.html

#49 lore raw

✓ Xe.CI.FULL: success for drm/xe: Isolate wedged devices from hardware access

In reply to Arvind Yadav
== Series Details ==

== Series Details ==

Series: drm/xe: Isolate wedged devices from hardware access
URL : https://patchwork.freedesktop.org/series/172860/
State : success

== Summary ==

CI Bug Log - changes from xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2_FULL -> xe-pw-172860v1_FULL
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (2 -> 2)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in xe-pw-172860v1_FULL that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_big_fb@y-tiled-16bpp-rotate-270:
- shard-bmg: NOTRUN -> [SKIP][1] ([Intel XE#1124])
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_ccs@crc-primary-suspend-4-tiled-mtl-mc-ccs:
- shard-bmg: NOTRUN -> [SKIP][2] ([Intel XE#3432])
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-2/igt@[email protected]

* igt@kms_chamelium_color_pipeline@plane-ctm3x4-lut1d:
- shard-bmg: NOTRUN -> [SKIP][3] ([Intel XE#7358])
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-2/igt@[email protected]

* igt@kms_chamelium_hpd@dp-hpd-for-each-pipe:
- shard-bmg: NOTRUN -> [SKIP][4] ([Intel XE#2252])
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_content_protection@srm:
- shard-bmg: NOTRUN -> [FAIL][5] ([Intel XE#1178] / [Intel XE#3304] / [Intel XE#7374]) +1 other test fail
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_cursor_crc@cursor-offscreen-512x170:
- shard-bmg: NOTRUN -> [SKIP][6] ([Intel XE#2321] / [Intel XE#7355])
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank@a-edp1:
- shard-lnl: [PASS][7] -> [FAIL][8] ([Intel XE#301]) +2 other tests fail
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-2/igt@kms_flip@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-4/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-offscreen-pri-shrfb-draw-blt:
- shard-bmg: NOTRUN -> [SKIP][9] ([Intel XE#4141]) +1 other test skip
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@kms_frontbuffer_tracking@fbc-1p-offscreen-pri-shrfb-draw-blt.html

* igt@kms_frontbuffer_tracking@fbcdrrshdr-2p-scndscrn-pri-shrfb-draw-render:
- shard-bmg: NOTRUN -> [SKIP][10] ([Intel XE#2311]) +8 other tests skip
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@kms_frontbuffer_tracking@fbcdrrshdr-2p-scndscrn-pri-shrfb-draw-render.html

* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-indfb-plflip-blt:
- shard-bmg: NOTRUN -> [SKIP][11] ([Intel XE#2313]) +6 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-indfb-plflip-blt.html

* igt@kms_frontbuffer_tracking@fbcpsr-abgr161616f-draw-blt:
- shard-bmg: NOTRUN -> [SKIP][12] ([Intel XE#7061] / [Intel XE#7356])
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_frontbuffer_tracking@hdr-argb161616f-draw-mmap-wc:
- shard-bmg: NOTRUN -> [SKIP][13] ([Intel XE#7061])
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-2/igt@[email protected]

* igt@kms_hdmi_inject@inject-audio:
- shard-bmg: NOTRUN -> [SKIP][14] ([Intel XE#7308])
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-2/igt@[email protected]

* igt@kms_psr@pr-cursor-plane-onoff:
- shard-bmg: NOTRUN -> [SKIP][15] ([Intel XE#2234] / [Intel XE#2850]) +2 other tests skip
[15]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-2/igt@[email protected]

* igt@xe_evict@evict-mixed-many-threads-small:
- shard-bmg: [PASS][16] -> [INCOMPLETE][17] ([Intel XE#6321] / [Intel XE#8355])
[16]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-7/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-3/igt@[email protected]

* igt@xe_exec_basic@multigpu-many-execqueues-many-vm-userptr:
- shard-bmg: NOTRUN -> [SKIP][18] ([Intel XE#2322] / [Intel XE#7372])
[18]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@xe_exec_fault_mode@many-multi-queue-imm:
- shard-bmg: NOTRUN -> [SKIP][19] ([Intel XE#8374])
[19]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@xe_exec_multi_queue@two-queues-basic-smem:
- shard-bmg: NOTRUN -> [SKIP][20] ([Intel XE#8364]) +2 other tests skip
[20]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@xe_exec_threads@threads-multi-queue-cm-fd-userptr-rebind:
- shard-bmg: NOTRUN -> [SKIP][21] ([Intel XE#8378])
[21]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@xe_fault_injection@inject-fault-probe-function-xe_device_probe_early:
- shard-bmg: [PASS][22] -> [ABORT][23] ([Intel XE#8007]) +1 other test abort
[22]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-7/igt@xe_fault_injection@inject-fault-probe-function-xe_device_probe_early.html
[23]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-6/igt@xe_fault_injection@inject-fault-probe-function-xe_device_probe_early.html

* igt@xe_query@multigpu-query-config:
- shard-bmg: NOTRUN -> [SKIP][24] ([Intel XE#944])
[24]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@xe_sriov_flr@flr-each-isolation:
- shard-bmg: NOTRUN -> [FAIL][25] ([Intel XE#7992])
[25]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

#### Possible fixes ####

* igt@core_hotunplug@hotunplug-rescan-with-load:
- shard-bmg: [ABORT][26] ([Intel XE#8007]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-9/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip-atomic:
- shard-bmg: [FAIL][28] ([Intel XE#3718] / [Intel XE#6078]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-1/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-3/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip-atomic@pipe-d-dp-2:
- shard-bmg: [FAIL][30] ([Intel XE#6078]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-1/igt@kms_async_flips@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-3/igt@kms_async_flips@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-lnl: [FAIL][32] ([Intel XE#301] / [Intel XE#3149]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-5/igt@kms_flip@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-5/igt@kms_flip@[email protected]

#### Warnings ####

* igt@kms_cursor_legacy@cursorb-vs-flipb-atomic-transitions:
- shard-lnl: [SKIP][34] ([Intel XE#309] / [Intel XE#7343]) -> [SKIP][35] ([Intel XE#309] / [Intel XE#7343] / [Intel XE#7935])
[34]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-3/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-8/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-lnl: [FAIL][36] ([Intel XE#301] / [Intel XE#3149]) -> [FAIL][37] ([Intel XE#301])
[36]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-5/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-5/igt@[email protected]

* igt@kms_hdr@brightness-with-hdr:
- shard-bmg: [SKIP][38] ([Intel XE#3374] / [Intel XE#3544]) -> [SKIP][39] ([Intel XE#3544])
[38]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-2/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-10/igt@[email protected]

* igt@kms_tiled_display@basic-test-pattern:
- shard-bmg: [FAIL][40] ([Intel XE#1729] / [Intel XE#7424]) -> [SKIP][41] ([Intel XE#2426] / [Intel XE#5848])
[40]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-bmg-1/igt@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-bmg-8/igt@[email protected]

* igt@xe_wedged@basic-wedged:
- shard-lnl: [ABORT][42] ([Intel XE#8963]) -> [ABORT][43] ([Intel XE#8007] / [Intel XE#8963])
[42]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-5/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-5/igt@[email protected]

* igt@xe_wedged@wedged-at-any-timeout:
- shard-lnl: [DMESG-WARN][44] ([Intel XE#8963]) -> [ABORT][45] ([Intel XE#8007] / [Intel XE#8963])
[44]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2/shard-lnl-4/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/shard-lnl-3/igt@[email protected]

[Intel XE#1124]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1124
[Intel XE#1178]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1178
[Intel XE#1729]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1729
[Intel XE#2234]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2234
[Intel XE#2252]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2252
[Intel XE#2311]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2311
[Intel XE#2313]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2313
[Intel XE#2321]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2321
[Intel XE#2322]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2322
[Intel XE#2426]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2426
[Intel XE#2850]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/2850
[Intel XE#301]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/301
[Intel XE#309]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/309
[Intel XE#3149]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3149
[Intel XE#3304]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3304
[Intel XE#3374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3374
[Intel XE#3432]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3432
[Intel XE#3544]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3544
[Intel XE#3718]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/3718
[Intel XE#4141]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/4141
[Intel XE#5848]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/5848
[Intel XE#6078]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6078
[Intel XE#6321]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/6321
[Intel XE#7061]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7061
[Intel XE#7308]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7308
[Intel XE#7343]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7343
[Intel XE#7355]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7355
[Intel XE#7356]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7356
[Intel XE#7358]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7358
[Intel XE#7372]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7372
[Intel XE#7374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7374
[Intel XE#7424]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7424
[Intel XE#7935]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7935
[Intel XE#7992]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/7992
[Intel XE#8007]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8007
[Intel XE#8355]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8355
[Intel XE#8364]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8364
[Intel XE#8374]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8374
[Intel XE#8378]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8378
[Intel XE#8963]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/8963
[Intel XE#944]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/944

Build changes
-------------

* Linux: xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2 -> xe-pw-172860v1

IGT_9076: 8f42b0189d73d9912ad58c99cfaa4ff46c20fcc3 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-5652-098021382451783ea6448fa7f0e2a4cbc395c3d2: 098021382451783ea6448fa7f0e2a4cbc395c3d2
xe-pw-172860v1: 172860v1

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-172860v1/index.html

#50 lore raw
In reply to Arvind Yadav
Quoted 72 lines · Arvind Yadav

A permanently wedged device can still access hardware through pending work,
existing VRAM mappings and background driver paths. This can cause unwanted
DMA or MMIO access while userspace is preparing device recovery.

This series separates temporary PCI error recovery from permanent wedging and
introduces a common device-I/O-blocked state.

After a permanent wedge, the driver:
- stops queued VM, SVM and GuC work.
- shuts down the display.
- invalidates existing CPU mappings to VRAM.
- maps later CPU faults to a per-BO dummy page.
- stops interrupts and clears PCI bus mastering.
- rejects new VRAM allocations.
- notifies userspace only after isolation completes.
- drops queued page faults and stops VM, SVM and GuC work.

System suspend waits for wedge isolation to complete before skipping the
normal suspend path. The worker cannot reach synchronize_srcu() until all
GTs have been declared wedged and their pending fences have been signalled.

The device remains isolated until userspace performs the advertised recovery,
such as driver rebind or bus reset.

The series also fixes IRQ uninstall so requested handlers are freed after
interrupts have already been suspended.

Arvind Yadav (13):
  drm/xe/irq: Always free requested IRQs on uninstall drm/xe: Separate AER reset state from device wedging drm/xe: Drop queued page faults when device I/O is blocked drm/xe: Stop VM work when device I/O is blocked drm/xe: Send wedged notification from a worker drm/xe: Reuse one dummy page per BO after wedge drm/xe: Invalidate existing VRAM mappings on wedge drm/xe/irq: Serialize IRQ suspend and resume drm/xe: Isolate a wedged device before notifying userspace drm/xe/ttm: Reject VRAM allocations on wedged devices drm/xe/guc: Skip timeout recovery on a wedged device drm/xe: Skip PM notifier preparation for wedged devices drm/xe: Block BO VM access when device I/O is unavailable

 drivers/gpu/drm/xe/display/xe_display.c |  18 +++- drivers/gpu/drm/xe/xe_bo.c              | 101 +++++++++++++++++++- drivers/gpu/drm/xe/xe_bo.h              |   1 + drivers/gpu/drm/xe/xe_bo_types.h        |   4 + drivers/gpu/drm/xe/xe_device.c          | 118 ++++++++++++++++++++-- --
 drivers/gpu/drm/xe/xe_device.h          |  12 +++ drivers/gpu/drm/xe/xe_device_types.h    |  26 ++++++

 drivers/gpu/drm/xe/xe_guc_ct.c          |   4 +-
 drivers/gpu/drm/xe/xe_guc_pc.c          |  10 +-
 drivers/gpu/drm/xe/xe_guc_rc.c          |   4 +-

 drivers/gpu/drm/xe/xe_guc_submit.c      |  13 ++- drivers/gpu/drm/xe/xe_guc_tlb_inval.c   |   8 +- drivers/gpu/drm/xe/xe_irq.c             |  32 +++++-- drivers/gpu/drm/xe/xe_pagefault.c       |  40 ++++++++ drivers/gpu/drm/xe/xe_pci.c             |  23 ++++- drivers/gpu/drm/xe/xe_pci_error.c       |  22 ++--- drivers/gpu/drm/xe/xe_pm.c              |  27 ++++++ drivers/gpu/drm/xe/xe_sriov_pf.c        |   2 +- drivers/gpu/drm/xe/xe_svm.c             |  21 ++++- drivers/gpu/drm/xe/xe_ttm_vram_mgr.c    |   4 + drivers/gpu/drm/xe/xe_vm.c              |  16 ++++

Quoted 1 line
 21 files changed, 446 insertions(+), 60 deletions(-)

Hi, Arvind.

I think this series lacks context to some extent. Much of the code is also inheritly racy [1]. because current hardware accesses aren't drained before reset or wedging. What I think is needed here is a design detailing

1) What type of user-space accesses and workqueues are completely blocked (for example sharing the newly introduced vram_userfault.srcu) This can perhaps also be combined with the drm SRCU since I figure there might be multiple places where we ensure hardware is present using drm_dev_enter / drm_dev_exit and also want to check whether it's wedged or not.

See an example in
https://gitlab.freedesktop.org/thomash/kernel/-/commits/wedge?ref_type=heads
(Note that this is just an example, not fully adapted to the intentions in this series).

2) How is user-space supposed to respond to a recoverable PCIe reset? Currently? If a change is planned, In the future? Is it the case that currently we flag "In reset" and then force the user to close its drm connection and re-discover a recovered device? Is this about to change and hence the distinction between PCIe reset and permanent wedging?

It looks like AMD might have an rwsem that just blocks callers over a reset and perhaps notifies them that, for example VRAM is lost. In any case, in addition to locking out new callers we need to drain old callers:

[1]
Thread A Thread B

is_io_allowed()
disable_io()

access_hardware() reset()

Bang!

Thanks,
Thomas

#51 lore raw
Quoted 88 lines · Thomas Hellström
Quoted 65 lines · Arvind Yadav

A permanently wedged device can still access hardware through pending work,
existing VRAM mappings and background driver paths. This can cause unwanted
DMA or MMIO access while userspace is preparing device recovery.

This series separates temporary PCI error recovery from permanent wedging and
introduces a common device-I/O-blocked state.

After a permanent wedge, the driver:
- stops queued VM, SVM and GuC work.
- shuts down the display.
- invalidates existing CPU mappings to VRAM.
- maps later CPU faults to a per-BO dummy page.
- stops interrupts and clears PCI bus mastering.
- rejects new VRAM allocations.
- notifies userspace only after isolation completes.
- drops queued page faults and stops VM, SVM and GuC work.

System suspend waits for wedge isolation to complete before skipping the
normal suspend path. The worker cannot reach synchronize_srcu() until all
GTs have been declared wedged and their pending fences have been signalled.

The device remains isolated until userspace performs the advertised recovery,
such as driver rebind or bus reset.

The series also fixes IRQ uninstall so requested handlers are freed after
interrupts have already been suspended.

Arvind Yadav (13):
  drm/xe/irq: Always free requested IRQs on uninstall drm/xe: Separate AER reset state from device wedging drm/xe: Drop queued page faults when device I/O is blocked drm/xe: Stop VM work when device I/O is blocked drm/xe: Send wedged notification from a worker drm/xe: Reuse one dummy page per BO after wedge drm/xe: Invalidate existing VRAM mappings on wedge drm/xe/irq: Serialize IRQ suspend and resume drm/xe: Isolate a wedged device before notifying userspace drm/xe/ttm: Reject VRAM allocations on wedged devices drm/xe/guc: Skip timeout recovery on a wedged device drm/xe: Skip PM notifier preparation for wedged devices drm/xe: Block BO VM access when device I/O is unavailable

  drivers/gpu/drm/xe/display/xe_display.c |  18 +++-
  drivers/gpu/drm/xe/xe_bo.c              | 101 +++++++++++++++++++-
  drivers/gpu/drm/xe/xe_bo.h              |   1 +
  drivers/gpu/drm/xe/xe_bo_types.h        |   4 +
  drivers/gpu/drm/xe/xe_device.c          | 118 ++++++++++++++++++++--
--
  drivers/gpu/drm/xe/xe_device.h          |  12 +++
  drivers/gpu/drm/xe/xe_device_types.h    |  26 ++++++
  drivers/gpu/drm/xe/xe_guc_ct.c          |   4 +-
  drivers/gpu/drm/xe/xe_guc_pc.c          |  10 +-
  drivers/gpu/drm/xe/xe_guc_rc.c          |   4 +-
  drivers/gpu/drm/xe/xe_guc_submit.c      |  13 ++-
  drivers/gpu/drm/xe/xe_guc_tlb_inval.c   |   8 +-
  drivers/gpu/drm/xe/xe_irq.c             |  32 +++++--
  drivers/gpu/drm/xe/xe_pagefault.c       |  40 ++++++++
Quoted 8 lines
  drivers/gpu/drm/xe/xe_pci.c             |  23 ++++-
  drivers/gpu/drm/xe/xe_pci_error.c       |  22 ++---
  drivers/gpu/drm/xe/xe_pm.c              |  27 ++++++
  drivers/gpu/drm/xe/xe_sriov_pf.c        |   2 +-
  drivers/gpu/drm/xe/xe_svm.c             |  21 ++++-
  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c    |   4 +
  drivers/gpu/drm/xe/xe_vm.c              |  16 ++++
  21 files changed, 446 insertions(+), 60 deletions(-)

Hi, Arvind.

I think this series lacks context to some extent. Much of the code is also inheritly racy [1]. because current hardware accesses aren't drained before reset or wedging. What I think is needed here is a design detailing

1) What type of user-space accesses and workqueues are completely blocked (for example sharing the newly introduced vram_userfault.srcu) This can perhaps also be combined with the drm SRCU since I figure there might be multiple places where we ensure hardware is present using drm_dev_enter / drm_dev_exit and also want to check whether it's wedged or not.

Quoted 4 lines

See an example in
https://gitlab.freedesktop.org/thomash/kernel/-/commits/wedge?ref_type=heads
(Note that this is just an example, not fully adapted to the intentions in this series).

Thanks Thomas. I will document all userspace and worker paths that need protection and rework them around one common synchronization domain. I will also check whether it can share the DRM SRCU.

Quoted 15 lines

2) How is user-space supposed to respond to a recoverable PCIe reset? Currently? If a change is planned, In the future? Is it the case that currently we flag "In reset" and then force the user to close its drm connection and re-discover a recovered device? Is this about to change and hence the distinction between PCIe reset and permanent wedging?

It looks like AMD might have an rwsem that just blocks callers over a reset and perhaps notifies them that, for example VRAM is lost. In any case, in addition to locking out new callers we need to drain old callers:

[1]
Thread A Thread B

Quoted 6 lines

is_io_allowed()
disable_io()

access_hardware() reset()

Bang!

Thanks Thomas. Agreed that the current xe_device_io_blocked checks only block new work. They do not drain a caller that already passed the check. As per your suggestion I will rework on this series.

Thanks,
Arvind

Quoted 3 lines

Thanks,
Thomas