All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] Introduce xe_wedge
@ 2026-10-13 11:03 Raag Jadav
  2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

In the history of xe technical debt, this series takes one more step and
consolidates all wedging implementation into a dedicated xe_wedge component.

While at it, this fixes a few pre-existing issues related to wedge handling.
Detailed description in commit message.

v1: https://patchwork.freedesktop.org/series/172727/

v2: Split fixes into separate patches (Rodrigo, Michal)
    Also move struct xe_wedge and wedged_mode debt to xe_wedge (Lukasz, Michal)
    Naming and aesthetic adjustments (Lukasz, Michal)

v3: Respect the component namespace (Rodrigo)
    Avoid chaining header includes (Rodrigo)
    Squash debugfs changes with xe_wedge patch (Lukasz)

v4: Introduce for_each_initialized_gt() (Michal)
    Include xe_sriov.h (Rodrigo)

v5: Drop IRQ safe wedging for its flawed design
    Flush GT wedge worker to avoid races (Sashiko)

Raag Jadav (5):
  drm/xe/gt: Use GT ordered workqueue for wedging
  drm/xe: Drop xe_device_set_wedged_method()
  drm/xe: Move xe_device_wedged_fini() registration to
    xe_device_probe_early()
  drm/xe: Introduce xe_wedge
  drm/xe/ras: Move xe_ras_process_errors() to xe_ras

 Documentation/gpu/xe/xe_device.rst          |   2 +-
 drivers/gpu/drm/xe/Makefile                 |   1 +
 drivers/gpu/drm/xe/tests/xe_kunit_helpers.c |   3 +-
 drivers/gpu/drm/xe/xe_amc.c                 |   4 +-
 drivers/gpu/drm/xe/xe_bo.c                  |   3 +-
 drivers/gpu/drm/xe/xe_debugfs.c             |  66 +----
 drivers/gpu/drm/xe/xe_device.c              | 190 +-------------
 drivers/gpu/drm/xe/xe_device.h              |  14 +-
 drivers/gpu/drm/xe/xe_device_types.h        |  28 +--
 drivers/gpu/drm/xe/xe_gsc.c                 |   4 +-
 drivers/gpu/drm/xe/xe_gt.c                  |  27 +-
 drivers/gpu/drm/xe/xe_gt.h                  |   2 +-
 drivers/gpu/drm/xe/xe_gt_sriov_vf.c         |   3 +-
 drivers/gpu/drm/xe/xe_gt_types.h            |   9 +
 drivers/gpu/drm/xe/xe_guc.c                 |   4 +-
 drivers/gpu/drm/xe/xe_guc.h                 |   2 +-
 drivers/gpu/drm/xe/xe_guc_ct.c              |   7 +-
 drivers/gpu/drm/xe/xe_guc_pc.c              |  11 +-
 drivers/gpu/drm/xe/xe_guc_rc.c              |   5 +-
 drivers/gpu/drm/xe/xe_guc_submit.c          |  14 +-
 drivers/gpu/drm/xe/xe_guc_tlb_inval.c       |   3 +-
 drivers/gpu/drm/xe/xe_mert.c                |   5 +-
 drivers/gpu/drm/xe/xe_pci_error.c           |   9 +-
 drivers/gpu/drm/xe/xe_ras.c                 |  11 +-
 drivers/gpu/drm/xe/xe_sriov_pf.c            |   3 +-
 drivers/gpu/drm/xe/xe_survivability_mode.c  |   4 +-
 drivers/gpu/drm/xe/xe_uc.c                  |   6 +-
 drivers/gpu/drm/xe/xe_uc.h                  |   2 +-
 drivers/gpu/drm/xe/xe_wedge.c               | 261 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_wedge.h               |  19 ++
 drivers/gpu/drm/xe/xe_wedge_types.h         |  39 +++
 31 files changed, 431 insertions(+), 330 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_wedge.c
 create mode 100644 drivers/gpu/drm/xe/xe_wedge.h
 create mode 100644 drivers/gpu/drm/xe/xe_wedge_types.h

-- 
2.43.0


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

* [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
@ 2026-10-13 11:03 ` Raag Jadav
  2026-10-13 11:19   ` sashiko-bot
  2026-10-13 18:29   ` Rodrigo Vivi
  2026-10-13 11:03 ` [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

Currently, xe_gt_declare_wedged() stops GuC CT and initiates exec queue
teardown synchronously. This can result in tdr timeout in cases where
the device is declared wedged while jobs are still in-flight.

Introduce a worker for GT specific wedge handling and queue the teardown
on GT ordered workqueue, so we don't disrupt the scheduler while jobs
are still in-flight.

While at it, introduce for_each_initialized_gt() macro and use it for
wedging GT. This helps avoid races in case the device is declared wedged
in probe sequence before GT is initialized.

Fixes: c9474b726b93 ("drm/xe: Wedge the entire device")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
---
v2: Split fixes into separate patches (Rodrigo, Michal)
v4: Introduce for_each_initialized_gt() (Michal)
v5: Flush GT wedge worker to avoid races (Sashiko)
---
 drivers/gpu/drm/xe/xe_device.c   |  2 +-
 drivers/gpu/drm/xe/xe_device.h   |  4 ++++
 drivers/gpu/drm/xe/xe_gt.c       | 18 ++++++++++++++++--
 drivers/gpu/drm/xe/xe_gt_types.h |  9 +++++++++
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 8392c9fad3c4..22ae10958d7f 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1432,7 +1432,7 @@ void xe_device_declare_wedged(struct xe_device *xe)
 			    WEDGED_URL, XE_BUG_URL);
 	}
 
-	for_each_gt(gt, xe, id)
+	for_each_initialized_gt(gt, xe, id)
 		xe_gt_declare_wedged(gt);
 
 	if (xe_device_wedged(xe)) {
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 83d6dafab53c..80bda9b548d5 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -139,6 +139,10 @@ static inline bool xe_device_uc_enabled(struct xe_device *xe)
 	for_each_gt((gt__), (tile__)->xe, (id__)) \
 		for_each_if((gt__)->tile == (tile__))
 
+#define for_each_initialized_gt(gt__, xe__, id__) \
+	for_each_gt((gt__), (xe__), (id__)) \
+		for_each_if(READ_ONCE((gt__)->initialized))
+
 static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
 {
 	return &gt->pm.fw;
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 775c826b68b4..4e047cfaf603 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -175,6 +175,7 @@ static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt)
 }
 
 static void gt_reset_worker(struct work_struct *w);
+static void gt_wedge_worker(struct work_struct *w);
 
 static int emit_job_sync(struct xe_exec_queue *q, struct xe_bb *bb,
 			 long timeout_jiffies, bool force_reset)
@@ -706,6 +707,8 @@ static void xe_gt_fini(void *arg)
 	struct xe_gt *gt = arg;
 	int i;
 
+	disable_work_sync(&gt->wedge.worker);
+
 	if (disable_work_sync(&gt->reset.worker))
 		/*
 		 * If gt_reset_worker was halted from executing, take care of
@@ -725,6 +728,7 @@ int xe_gt_init(struct xe_gt *gt)
 	int i;
 
 	INIT_WORK(&gt->reset.worker, gt_reset_worker);
+	INIT_WORK(&gt->wedge.worker, gt_wedge_worker);
 
 	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i) {
 		gt->ring_ops[i] = xe_ring_ops_get(gt, i);
@@ -769,6 +773,8 @@ int xe_gt_init(struct xe_gt *gt)
 			return err;
 	}
 
+	/* Must be last */
+	WRITE_ONCE(gt->initialized, true);
 	return 0;
 }
 
@@ -1010,6 +1016,14 @@ void xe_gt_reset_async(struct xe_gt *gt)
 		xe_pm_runtime_put(xe);
 }
 
+static void gt_wedge_worker(struct work_struct *w)
+{
+	struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
+
+	xe_uc_declare_wedged(&gt->uc);
+	xe_tlb_inval_reset(&gt->tlb_inval);
+}
+
 void xe_gt_suspend_prepare(struct xe_gt *gt)
 {
 	xe_uc_suspend_prepare(&gt->uc);
@@ -1200,6 +1214,6 @@ void xe_gt_declare_wedged(struct xe_gt *gt)
 {
 	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
 
-	xe_uc_declare_wedged(&gt->uc);
-	xe_tlb_inval_reset(&gt->tlb_inval);
+	queue_work(gt->ordered_wq, &gt->wedge.worker);
+	flush_work(&gt->wedge.worker);
 }
diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
index 628911346455..c00a7c171f80 100644
--- a/drivers/gpu/drm/xe/xe_gt_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_types.h
@@ -233,6 +233,12 @@ struct xe_gt {
 		struct work_struct worker;
 	} reset;
 
+	/** @wedge: state for GT wedge */
+	struct {
+		/** @wedge.worker: worker for GT wedge to be done async */
+		struct work_struct worker;
+	} wedge;
+
 	/** @tlb_inval: TLB invalidation state */
 	struct xe_tlb_inval tlb_inval;
 
@@ -419,6 +425,9 @@ struct xe_gt {
 
 	/** @eu_stall: EU stall counters subsystem per gt info */
 	struct xe_eu_stall_gt *eu_stall;
+
+	/** @initialized: GT is initialized */
+	bool initialized;
 };
 
 #endif
-- 
2.43.0


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

* [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method()
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
  2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
@ 2026-10-13 11:03 ` Raag Jadav
  2026-10-13 11:20   ` sashiko-bot
  2026-10-13 18:30   ` Rodrigo Vivi
  2026-10-13 11:03 ` [PATCH v5 3/5] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Raag Jadav
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

Commit 60439ac3f235 ("drm/xe: Add a helper function to set recovery
method") introduced xe_device_set_wedged_method() helper to allow setting
preferred recovery method before wedging the device, but also introduced
a flaw where the previously set method can be overwritten by concurrent
racing wedge call. This can result in unintended recovery method to be
sent to userspace and possibly failed recovery.

Drop xe_device_set_wedged_method() entirely and pass the recovery method
as part of xe_device_declare_wedged() argument, which places the preferred
recovery method on stack and avoids this issue.

Fixes: 60439ac3f235 ("drm/xe: Add a helper function to set recovery method")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/gpu/drm/xe/xe_amc.c                |  3 ++-
 drivers/gpu/drm/xe/xe_device.c             | 23 ++++------------------
 drivers/gpu/drm/xe/xe_device.h             |  3 +--
 drivers/gpu/drm/xe/xe_device_types.h       |  2 --
 drivers/gpu/drm/xe/xe_gsc.c                |  3 ++-
 drivers/gpu/drm/xe/xe_gt.c                 |  3 ++-
 drivers/gpu/drm/xe/xe_gt_sriov_vf.c        |  2 +-
 drivers/gpu/drm/xe/xe_guc_submit.c         |  5 +++--
 drivers/gpu/drm/xe/xe_mert.c               |  6 ++++--
 drivers/gpu/drm/xe/xe_pci_error.c          |  3 ++-
 drivers/gpu/drm/xe/xe_ras.c                |  3 +--
 drivers/gpu/drm/xe/xe_survivability_mode.c |  3 +--
 12 files changed, 23 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_amc.c b/drivers/gpu/drm/xe/xe_amc.c
index 8ecadee6eea3..b7390a4ee3ce 100644
--- a/drivers/gpu/drm/xe/xe_amc.c
+++ b/drivers/gpu/drm/xe/xe_amc.c
@@ -160,7 +160,8 @@ static void xe_amc_work(struct work_struct *work)
 	case AMC_ALERT_OOB_RESET:
 	case AMC_ALERT_CATERR:
 		dev_warn(amc->i2c->drm_dev, "AMC Alert: %s\n", amc_alert[alert_reason]);
-		xe_device_declare_wedged(i2c_client_to_xe_device(client));
+		xe_device_declare_wedged(i2c_client_to_xe_device(client),
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	default:
 		dev_warn(amc->i2c->drm_dev, "unknown AMC alert: %d\n", alert_reason);
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 22ae10958d7f..0d9ef4f1ab9a 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1378,24 +1378,13 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
  *   firmware and restore device to normal operation.
  */
 
-/**
- * xe_device_set_wedged_method - Set wedged recovery method
- * @xe: xe device instance
- * @method: recovery method to set
- *
- * Set wedged recovery method to be sent in drm wedged uevent.
- */
-void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
-{
-	xe->wedged.method = method;
-}
-
 #define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
 #define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
 
 /**
  * xe_device_declare_wedged - Declare device wedged
  * @xe: xe device instance
+ * @method: method(s) to be used for recovery
  *
  * This is a final state that can only be cleared with the recovery method
  * specified in the drm wedged uevent. The method can be set using
@@ -1411,7 +1400,7 @@ void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
  * snapshot capture. In this mode, GT reset won't be attempted so the state of
  * the issue is preserved for further debugging.
  */
-void xe_device_declare_wedged(struct xe_device *xe)
+void xe_device_declare_wedged(struct xe_device *xe, unsigned long method)
 {
 	struct xe_gt *gt;
 	u8 id;
@@ -1442,14 +1431,10 @@ void xe_device_declare_wedged(struct xe_device *xe)
 		 * it available to the user for debugging.
 		 */
 		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);
+			method = DRM_WEDGE_RECOVERY_NONE;
 
 		/* Notify userspace of wedged device */
-		drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL);
+		drm_dev_wedged_event(&xe->drm, method, NULL);
 	}
 }
 
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 80bda9b548d5..9f35370c0851 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -264,8 +264,7 @@ static inline bool xe_debug_page_size_mode_is_mixed(struct xe_device *xe)
 }
 #endif
 
-void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method);
-void xe_device_declare_wedged(struct xe_device *xe);
+void xe_device_declare_wedged(struct xe_device *xe, unsigned long method);
 int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode);
 const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode);
 
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 4e0e1bc040c1..00ce8e9872ea 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -543,8 +543,6 @@ struct xe_device {
 		atomic_t flag;
 		/** @wedged.mode: Mode controlled by kernel parameter and debugfs */
 		enum xe_wedged_mode mode;
-		/** @wedged.method: Recovery method to be sent in the drm device wedged uevent */
-		unsigned long method;
 		/** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
 		bool inconsistent_reset;
 	} wedged;
diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
index 524ac56bdcc7..2bbe0f20ff8d 100644
--- a/drivers/gpu/drm/xe/xe_gsc.c
+++ b/drivers/gpu/drm/xe/xe_gsc.c
@@ -340,7 +340,8 @@ static int gsc_er_complete(struct xe_gt *gt)
 		 * declare the device as wedged.
 		 */
 		xe_gt_err(gt, "GSC ER timed out!\n");
-		xe_device_declare_wedged(gt_to_xe(gt));
+		xe_device_declare_wedged(gt_to_xe(gt),
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		return -EIO;
 	}
 
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 4e047cfaf603..f35ae3a532ee 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -992,7 +992,8 @@ static void gt_reset_worker(struct work_struct *w)
 
 err_fail:
 	xe_log_err_fatal(gt, GT, err, "reset failed\n");
-	xe_device_declare_wedged(gt_to_xe(gt));
+	xe_device_declare_wedged(gt_to_xe(gt),
+				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 err_pm_put:
 	xe_pm_runtime_put(gt_to_xe(gt));
 }
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
index 37899fcf5b22..28ec83bb8100 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
@@ -1462,7 +1462,7 @@ static void vf_post_migration_recovery(struct xe_gt *gt)
 fail:
 	vf_post_migration_abort(gt);
 	xe_gt_sriov_err(gt, "migration recovery failed (%pe)\n", ERR_PTR(err));
-	xe_device_declare_wedged(xe);
+	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 	return;
 
 queue:
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 7ce73489c35f..e2a0b989cfc8 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1453,7 +1453,7 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc)
 	if (xe_device_wedged(xe))
 		return true;
 
-	xe_device_declare_wedged(xe);
+	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 
 	return true;
 }
@@ -1780,7 +1780,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	}
 
 	if (wedge_device)
-		xe_device_declare_wedged(gt_to_xe(q->gt));
+		xe_device_declare_wedged(gt_to_xe(q->gt),
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 
 	/*
 	 * We want the job added back to the pending list so it gets freed; this
diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c
index 32700c19a1df..934be933d57f 100644
--- a/drivers/gpu/drm/xe/xe_mert.c
+++ b/drivers/gpu/drm/xe/xe_mert.c
@@ -74,7 +74,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
 		break;
 	case CATERR_UNMAPPED_GGTT:
 		xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
-		xe_device_declare_wedged(xe);
+		xe_device_declare_wedged(xe,
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	case CATERR_LMTT_FAULT:
 		xe_sriov_dbg_ratelimited(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
@@ -82,7 +83,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
 		break;
 	default:
 		xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
-		xe_device_declare_wedged(xe);
+		xe_device_declare_wedged(xe,
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	}
 }
diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
index 79ce0c671549..fdecd3e0b9a9 100644
--- a/drivers/gpu/drm/xe/xe_pci_error.c
+++ b/drivers/gpu/drm/xe/xe_pci_error.c
@@ -86,7 +86,8 @@ static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev)
 
 	/* User wants to debug the error, prevent reset */
 	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
-		xe_device_declare_wedged(xe);
+		xe_device_declare_wedged(xe,
+					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		return PCI_ERS_RESULT_DISCONNECT;
 	}
 
diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 7a85735c57d5..fe16a4106060 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -321,8 +321,7 @@ static u8 handle_core_compute_errors(struct xe_ras_error_array *arr)
 
 static void punit_error_handler(struct xe_device *xe)
 {
-	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
-	xe_device_declare_wedged(xe);
+	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
 }
 
 static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_array *arr)
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index 45d44ebe288b..ca031576fecb 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -446,8 +446,7 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
 	survivability->type = XE_SURVIVABILITY_TYPE_RUNTIME;
 	xe_log_err(xe, SURVIVABILITY, 0, "Runtime Mode enabled!\n");
 
-	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_VENDOR);
-	xe_device_declare_wedged(xe);
+	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_VENDOR);
 
 	xe_log_err(xe, SURVIVABILITY, 0, "Firmware flash required!\n");
 	xe_info(xe, "Please refer to the userspace documentation for more details how to flash the firmware on %s!\n",
-- 
2.43.0


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

* [PATCH v5 3/5] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early()
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
  2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
  2026-10-13 11:03 ` [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
@ 2026-10-13 11:03 ` Raag Jadav
  2026-10-13 11:03 ` [PATCH v5 4/5] drm/xe: Introduce xe_wedge Raag Jadav
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

The device can be declared wedged while processing boot-time hardware
errors, which can result in PM reference leak if driver probe fails
before xe_device_wedged_fini() is registered.

Early register the required cleanup action and fix this.

Fixes: a7df563b45b0 ("drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
v2: Split fixes into separate patches (Rodrigo, Michal)
---
 drivers/gpu/drm/xe/xe_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 0d9ef4f1ab9a..f4bcc27f4b71 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -697,6 +697,8 @@ static int xe_device_vram_alloc(struct xe_device *xe)
 	return 0;
 }
 
+static void xe_device_wedged_fini(struct drm_device *drm, void *arg);
+
 /**
  * xe_device_probe_early: Device early probe
  * @xe: xe device instance
@@ -765,6 +767,10 @@ int xe_device_probe_early(struct xe_device *xe)
 	if (err)
 		return err;
 
+	err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
+	if (err)
+		return err;
+
 	return 0;
 }
 ALLOW_ERROR_INJECTION(xe_device_probe_early, ERRNO); /* See xe_pci_probe() */
@@ -1095,10 +1101,6 @@ int xe_device_probe(struct xe_device *xe)
 
 	detect_preproduction_hw(xe);
 
-	err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
-	if (err)
-		goto err_unregister_display;
-
 	/*
 	 * Process and log any errors detected by hardware. Possible results can
 	 * include declaring the device as wedged, which must be done only after
-- 
2.43.0


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

* [PATCH v5 4/5] drm/xe: Introduce xe_wedge
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
                   ` (2 preceding siblings ...)
  2026-10-13 11:03 ` [PATCH v5 3/5] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Raag Jadav
@ 2026-10-13 11:03 ` Raag Jadav
  2026-10-13 11:16   ` sashiko-bot
  2026-10-13 18:32   ` Rodrigo Vivi
  2026-10-13 11:03 ` [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

Consolidate wedging implementation into a dedicated xe_wedge component
for better maintainability. While at it, rename all wedge helpers
to match with component name.

No functional impact.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Matthew Brost <matthew.brost@intel.com>
---
v2: Also move struct xe_wedge and wedged_mode debt to xe_wedge (Lukasz, Michal)
    Naming and aesthetic adjustments (Lukasz, Michal)
v3: Respect the component namespace (Rodrigo)
    Avoid chaining header includes (Rodrigo)
    Squash debugfs changes with xe_wedge patch (Lukasz)
v4: Include xe_sriov.h (Rodrigo)
---
 Documentation/gpu/xe/xe_device.rst          |   2 +-
 drivers/gpu/drm/xe/Makefile                 |   1 +
 drivers/gpu/drm/xe/tests/xe_kunit_helpers.c |   3 +-
 drivers/gpu/drm/xe/xe_amc.c                 |   5 +-
 drivers/gpu/drm/xe/xe_bo.c                  |   3 +-
 drivers/gpu/drm/xe/xe_debugfs.c             |  66 +----
 drivers/gpu/drm/xe/xe_device.c              | 166 +------------
 drivers/gpu/drm/xe/xe_device.h              |   9 -
 drivers/gpu/drm/xe/xe_device_types.h        |  26 +-
 drivers/gpu/drm/xe/xe_gsc.c                 |   5 +-
 drivers/gpu/drm/xe/xe_gt.c                  |  12 +-
 drivers/gpu/drm/xe/xe_gt.h                  |   2 +-
 drivers/gpu/drm/xe/xe_gt_sriov_vf.c         |   3 +-
 drivers/gpu/drm/xe/xe_guc.c                 |   4 +-
 drivers/gpu/drm/xe/xe_guc.h                 |   2 +-
 drivers/gpu/drm/xe/xe_guc_ct.c              |   7 +-
 drivers/gpu/drm/xe/xe_guc_pc.c              |  11 +-
 drivers/gpu/drm/xe/xe_guc_rc.c              |   5 +-
 drivers/gpu/drm/xe/xe_guc_submit.c          |  15 +-
 drivers/gpu/drm/xe/xe_guc_tlb_inval.c       |   3 +-
 drivers/gpu/drm/xe/xe_mert.c                |   7 +-
 drivers/gpu/drm/xe/xe_pci_error.c           |  10 +-
 drivers/gpu/drm/xe/xe_ras.c                 |   3 +-
 drivers/gpu/drm/xe/xe_sriov_pf.c            |   3 +-
 drivers/gpu/drm/xe/xe_survivability_mode.c  |   3 +-
 drivers/gpu/drm/xe/xe_uc.c                  |   6 +-
 drivers/gpu/drm/xe/xe_uc.h                  |   2 +-
 drivers/gpu/drm/xe/xe_wedge.c               | 261 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_wedge.h               |  19 ++
 drivers/gpu/drm/xe/xe_wedge_types.h         |  39 +++
 30 files changed, 394 insertions(+), 309 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_wedge.c
 create mode 100644 drivers/gpu/drm/xe/xe_wedge.h
 create mode 100644 drivers/gpu/drm/xe/xe_wedge_types.h

diff --git a/Documentation/gpu/xe/xe_device.rst b/Documentation/gpu/xe/xe_device.rst
index d3a022362ade..8baed81580c9 100644
--- a/Documentation/gpu/xe/xe_device.rst
+++ b/Documentation/gpu/xe/xe_device.rst
@@ -6,7 +6,7 @@
 Xe Device Wedging
 ==================
 
-.. kernel-doc:: drivers/gpu/drm/xe/xe_device.c
+.. kernel-doc:: drivers/gpu/drm/xe/xe_wedge.c
    :doc: Xe Device Wedging
 
 ====================
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 011f7ef54086..bc203940f114 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -154,6 +154,7 @@ xe-y += xe_bb.o \
 	xe_vsec.o \
 	xe_wa.o \
 	xe_wait_user_fence.o \
+	xe_wedge.o \
 	xe_wopcm.o
 
 xe-$(CONFIG_I2C)	+= xe_i2c.o \
diff --git a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
index 27740b40c8ae..57ea88cce92d 100644
--- a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
+++ b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
@@ -15,6 +15,7 @@
 #include "xe_device.h"
 #include "xe_device_types.h"
 #include "xe_pm.h"
+#include "xe_wedge.h"
 
 /**
  * xe_kunit_helper_alloc_xe_device - Allocate a &xe_device for a KUnit test.
@@ -123,7 +124,7 @@ int xe_kunit_helper_xe_device_live_test_init(struct kunit *test)
 	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe);
 	kunit_info(test, "running on %s device\n", xe->info.platform_name);
 
-	KUNIT_ASSERT_FALSE(test, xe_device_wedged(xe));
+	KUNIT_ASSERT_FALSE(test, xe_wedged(xe));
 	xe_pm_runtime_get(xe);
 	KUNIT_ASSERT_EQ(test, 0, kunit_add_action_or_reset(test, put_xe_pm_runtime, xe));
 
diff --git a/drivers/gpu/drm/xe/xe_amc.c b/drivers/gpu/drm/xe/xe_amc.c
index b7390a4ee3ce..3b91c0d489f5 100644
--- a/drivers/gpu/drm/xe/xe_amc.c
+++ b/drivers/gpu/drm/xe/xe_amc.c
@@ -18,6 +18,7 @@
 #include "xe_device.h"
 #include "xe_i2c.h"
 #include "xe_mmio.h"
+#include "xe_wedge.h"
 
 /**
  * DOC: Add-In Management Controller (AMC)
@@ -160,8 +161,8 @@ static void xe_amc_work(struct work_struct *work)
 	case AMC_ALERT_OOB_RESET:
 	case AMC_ALERT_CATERR:
 		dev_warn(amc->i2c->drm_dev, "AMC Alert: %s\n", amc_alert[alert_reason]);
-		xe_device_declare_wedged(i2c_client_to_xe_device(client),
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(i2c_client_to_xe_device(client),
+				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	default:
 		dev_warn(amc->i2c->drm_dev, "unknown AMC alert: %d\n", alert_reason);
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 12e523c61c1f..10a3f156a9d3 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -41,6 +41,7 @@
 #include "xe_ttm_stolen_mgr.h"
 #include "xe_vm.h"
 #include "xe_vram_types.h"
+#include "xe_wedge.h"
 
 const char *const xe_mem_type_to_name[TTM_NUM_MEM_TYPES]  = {
 	[XE_PL_SYSTEM] = "system",
@@ -2203,7 +2204,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_wedged(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);
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 926020c7526e..e59d4964d811 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -18,13 +18,12 @@
 #include "xe_force_wake.h"
 #include "xe_gt.h"
 #include "xe_gt_debugfs.h"
-#include "xe_gt_printk.h"
-#include "xe_guc_ads.h"
 #include "xe_hw_engine.h"
 #include "xe_mmio.h"
 #include "xe_pagefault.h"
 #include "xe_pcode.h"
 #include "xe_pm.h"
+#include "xe_printk.h"
 #include "xe_psmi.h"
 #include "xe_pxp_debugfs.h"
 #include "xe_sriov.h"
@@ -36,6 +35,7 @@
 #include "xe_ttm_vram_mgr.h"
 #include "xe_vsec.h"
 #include "xe_wa.h"
+#include "xe_wedge.h"
 
 #ifdef CONFIG_DRM_XE_DEBUG
 #include "xe_bo_evict.h"
@@ -424,58 +424,6 @@ static ssize_t wedged_mode_show(struct file *f, char __user *ubuf,
 	return simple_read_from_buffer(ubuf, size, pos, buf, len);
 }
 
-static int __wedged_mode_set_reset_policy(struct xe_gt *gt, enum xe_wedged_mode mode)
-{
-	bool enable_engine_reset;
-	int ret;
-
-	enable_engine_reset = (mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET);
-	ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads,
-						       enable_engine_reset);
-	if (ret)
-		xe_gt_err(gt, "Failed to update GuC ADS scheduler policy (%pe)\n", ERR_PTR(ret));
-
-	return ret;
-}
-
-static int wedged_mode_set_reset_policy(struct xe_device *xe, enum xe_wedged_mode mode)
-{
-	struct xe_gt *gt;
-	int ret;
-	u8 id;
-
-	guard(xe_pm_runtime)(xe);
-	for_each_gt(gt, xe, id) {
-		ret = __wedged_mode_set_reset_policy(gt, mode);
-		if (ret) {
-			if (id > 0) {
-				xe->wedged.inconsistent_reset = true;
-				drm_err(&xe->drm, "Inconsistent reset policy state between GTs\n");
-			}
-			return ret;
-		}
-	}
-
-	xe->wedged.inconsistent_reset = false;
-
-	return 0;
-}
-
-static bool wedged_mode_needs_policy_update(struct xe_device *xe, enum xe_wedged_mode mode)
-{
-	if (xe->wedged.inconsistent_reset)
-		return true;
-
-	if (xe->wedged.mode == mode)
-		return false;
-
-	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET ||
-	    mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
-		return true;
-
-	return false;
-}
-
 static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
 			       size_t size, loff_t *pos)
 {
@@ -487,18 +435,10 @@ static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
 	if (ret)
 		return ret;
 
-	ret = xe_device_validate_wedged_mode(xe, wedged_mode);
+	ret = xe_wedge_set_mode(xe, wedged_mode);
 	if (ret)
 		return ret;
 
-	if (wedged_mode_needs_policy_update(xe, wedged_mode)) {
-		ret = wedged_mode_set_reset_policy(xe, wedged_mode);
-		if (ret)
-			return ret;
-	}
-
-	xe->wedged.mode = wedged_mode;
-
 	return size;
 }
 
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index f4bcc27f4b71..e0466390219c 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -81,6 +81,7 @@
 #include "xe_vsec.h"
 #include "xe_wait_user_fence.h"
 #include "xe_wa.h"
+#include "xe_wedge.h"
 
 #include <generated/xe_device_wa_oob.h>
 #include <generated/xe_wa_oob.h>
@@ -238,7 +239,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_wedged(xe))
 		return -ECANCELED;
 
 	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
@@ -256,7 +257,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_wedged(xe))
 		return -ECANCELED;
 
 	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
@@ -697,8 +698,6 @@ static int xe_device_vram_alloc(struct xe_device *xe)
 	return 0;
 }
 
-static void xe_device_wedged_fini(struct drm_device *drm, void *arg);
-
 /**
  * xe_device_probe_early: Device early probe
  * @xe: xe device instance
@@ -758,16 +757,11 @@ int xe_device_probe_early(struct xe_device *xe)
 	 */
 	assert_lmem_ready(xe);
 
-	xe->wedged.mode = xe_device_validate_wedged_mode(xe, xe_modparam.wedged_mode) ?
-			  XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
-	drm_dbg(&xe->drm, "wedged_mode: setting mode (%u) %s\n",
-		xe->wedged.mode, xe_wedged_mode_to_string(xe->wedged.mode));
-
 	err = xe_device_vram_alloc(xe);
 	if (err)
 		return err;
 
-	err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
+	err = xe_wedge_init(xe);
 	if (err)
 		return err;
 
@@ -857,14 +851,6 @@ static void detect_preproduction_hw(struct xe_device *xe)
 	}
 }
 
-static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
-{
-	struct xe_device *xe = arg;
-
-	if (atomic_read(&xe->wedged.flag))
-		xe_pm_runtime_put(xe);
-}
-
 #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
 static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
 {
@@ -1104,7 +1090,7 @@ int xe_device_probe(struct xe_device *xe)
 	/*
 	 * Process and log any errors detected by hardware. Possible results can
 	 * include declaring the device as wedged, which must be done only after
-	 * xe_device_wedged_fini() is registered.
+	 * xe_wedge_fini() is registered.
 	 */
 	xe_ras_process_errors(xe);
 
@@ -1343,148 +1329,6 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
 	return address & GENMASK_ULL(xe->info.va_bits - 1, 0);
 }
 
-/**
- * DOC: Xe Device Wedging
- *
- * Xe driver uses drm device wedged uevent as documented in Documentation/gpu/drm-uapi.rst.
- * When device is in wedged state, every IOCTL will be blocked and GT cannot
- * be used. The conditions under which the driver declares the device wedged
- * depend on the wedged mode configuration (see &enum xe_wedged_mode). The
- * default recovery method for a wedged state is rebind/bus-reset.
- *
- * Another recovery method is vendor-specific. Below are the cases that send
- * ``WEDGED=vendor-specific`` recovery method in drm device wedged uevent.
- *
- * Case: Firmware Flash
- * --------------------
- *
- * Identification Hint
- * +++++++++++++++++++
- *
- * ``WEDGED=vendor-specific`` drm device wedged uevent with
- * :ref:`Runtime Survivability mode <xe-survivability-mode>` is used to notify
- * admin/userspace consumer about the need for a firmware flash.
- *
- * Recovery Procedure
- * ++++++++++++++++++
- *
- * Once ``WEDGED=vendor-specific`` drm device wedged uevent is received, follow
- * the below steps
- *
- * - Check Runtime Survivability mode sysfs.
- *   If enabled, firmware flash is required to recover the device.
- *
- *   /sys/bus/pci/devices/<device>/survivability_mode
- *
- * - Admin/userspace consumer can use firmware flashing tools like fwupd to flash
- *   firmware and restore device to normal operation.
- */
-
-#define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
-#define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
-
-/**
- * xe_device_declare_wedged - Declare device wedged
- * @xe: xe device instance
- * @method: method(s) to be used for recovery
- *
- * This is a final state that can only be cleared with the recovery method
- * specified in the drm wedged uevent. The method can be set using
- * xe_device_set_wedged_method before declaring the device as wedged. If no method
- * is set, reprobe (unbind/re-bind) will be sent by default.
- *
- * In this state every IOCTL will be blocked so the GT cannot be used.
- * In general it will be called upon any critical error such as gt reset
- * failure or guc loading failure. Userspace will be notified of this state
- * through device wedged uevent.
- * If xe.wedged module parameter is set to 2, this function will be called
- * on every single execution timeout (a.k.a. GPU hang) right after devcoredump
- * snapshot capture. In this mode, GT reset won't be attempted so the state of
- * the issue is preserved for further debugging.
- */
-void xe_device_declare_wedged(struct xe_device *xe, unsigned long method)
-{
-	struct xe_gt *gt;
-	u8 id;
-
-	if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
-		drm_dbg(&xe->drm, "Wedged mode is forcibly disabled\n");
-		return;
-	}
-
-	if (!atomic_xchg(&xe->wedged.flag, 1)) {
-		xe->needs_flr_on_fini = true;
-		xe_pm_runtime_get_noresume(xe);
-
-		xe_log_err_fatal(xe, WEDGED, -EIO, "Device declared wedged!\n");
-		xe_err_once(xe, "IOCTLs and executions are now blocked!\n"
-			    "For recovery procedure, refer to %s\n"
-			    "Please file a _new_ bug report at %s\n",
-			    WEDGED_URL, XE_BUG_URL);
-	}
-
-	for_each_initialized_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
-		 * it available to the user for debugging.
-		 */
-		if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
-			method = DRM_WEDGE_RECOVERY_NONE;
-
-		/* Notify userspace of wedged device */
-		drm_dev_wedged_event(&xe->drm, method, NULL);
-	}
-}
-
-/**
- * xe_device_validate_wedged_mode - Check if given mode is supported
- * @xe: the &xe_device
- * @mode: requested mode to validate
- *
- * Check whether the provided wedged mode is supported.
- *
- * Return: 0 if mode is supported, error code otherwise.
- */
-int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode)
-{
-	if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
-		drm_dbg(&xe->drm, "wedged_mode: invalid value (%u)\n", mode);
-		return -EINVAL;
-	} else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
-		   (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
-		drm_dbg(&xe->drm, "wedged_mode: (%u) %s mode is not supported for %s\n",
-			mode, xe_wedged_mode_to_string(mode),
-			xe_sriov_mode_to_string(xe_device_sriov_mode(xe)));
-		return -EPERM;
-	}
-
-	return 0;
-}
-
-/**
- * xe_wedged_mode_to_string - Convert enum value to string.
- * @mode: the &xe_wedged_mode to convert
- *
- * Returns: wedged mode as a user friendly string.
- */
-const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode)
-{
-	switch (mode) {
-	case XE_WEDGED_MODE_NEVER:
-		return "never";
-	case XE_WEDGED_MODE_UPON_CRITICAL_ERROR:
-		return "upon-critical-error";
-	case XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET:
-		return "upon-any-hang-no-reset";
-	default:
-		return "<invalid>";
-	}
-}
-
 /**
  * xe_device_asid_to_vm() - Find VM from ASID
  * @xe: the &xe_device
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 9f35370c0851..6df60edcb8f8 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -211,11 +211,6 @@ bool xe_device_is_l2_flush_optimized(struct xe_device *xe);
 void xe_device_td_flush(struct xe_device *xe);
 void xe_device_l2_flush(struct xe_device *xe, bool force);
 
-static inline bool xe_device_wedged(struct xe_device *xe)
-{
-	return atomic_read(&xe->wedged.flag);
-}
-
 #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
 static inline bool xe_debug_page_size_supported(struct xe_device *xe)
 {
@@ -264,10 +259,6 @@ static inline bool xe_debug_page_size_mode_is_mixed(struct xe_device *xe)
 }
 #endif
 
-void xe_device_declare_wedged(struct xe_device *xe, unsigned long method);
-int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode);
-const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode);
-
 struct xe_file *xe_file_get(struct xe_file *xef);
 void xe_file_put(struct xe_file *xef);
 
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 00ce8e9872ea..25b38258b629 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -30,6 +30,7 @@
 #include "xe_sysctrl_types.h"
 #include "xe_tile_types.h"
 #include "xe_validation.h"
+#include "xe_wedge_types.h"
 
 #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
 #define TEST_VM_OPS_ERROR
@@ -47,22 +48,6 @@ struct xe_pxp;
 struct xe_ttm_stolen_mgr;
 struct xe_vram_region;
 
-/**
- * enum xe_wedged_mode - possible wedged modes
- * @XE_WEDGED_MODE_NEVER: Device will never be declared wedged.
- * @XE_WEDGED_MODE_UPON_CRITICAL_ERROR: Device will be declared wedged only
- *	when critical error occurs like GT reset failure or firmware failure.
- *	This is the default mode.
- * @XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET: Device will be declared wedged on
- *	any hang. In this mode, engine resets are disabled to avoid automatic
- *	recovery attempts. This mode is primarily intended for debugging hangs.
- */
-enum xe_wedged_mode {
-	XE_WEDGED_MODE_NEVER = 0,
-	XE_WEDGED_MODE_UPON_CRITICAL_ERROR = 1,
-	XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
-};
-
 #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
 /**
  * enum xe_page_size_alloc_ctrl_mode - User BO page-size allocation control modes
@@ -538,14 +523,7 @@ struct xe_device {
 	atomic_t in_reset;
 
 	/** @wedged: Struct to control Wedged States and mode */
-	struct {
-		/** @wedged.flag: Xe device faced a critical error and is now blocked. */
-		atomic_t flag;
-		/** @wedged.mode: Mode controlled by kernel parameter and debugfs */
-		enum xe_wedged_mode mode;
-		/** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
-		bool inconsistent_reset;
-	} wedged;
+	struct xe_wedge wedged;
 
 	/** @devres_group: devres group */
 	void *devres_group;
diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
index 2bbe0f20ff8d..db669a953886 100644
--- a/drivers/gpu/drm/xe/xe_gsc.c
+++ b/drivers/gpu/drm/xe/xe_gsc.c
@@ -31,6 +31,7 @@
 #include "xe_sched_job.h"
 #include "xe_uc_fw.h"
 #include "xe_wa.h"
+#include "xe_wedge.h"
 #include "instructions/xe_gsc_commands.h"
 #include "regs/xe_gsc_regs.h"
 #include "regs/xe_gt_regs.h"
@@ -340,8 +341,8 @@ static int gsc_er_complete(struct xe_gt *gt)
 		 * declare the device as wedged.
 		 */
 		xe_gt_err(gt, "GSC ER timed out!\n");
-		xe_device_declare_wedged(gt_to_xe(gt),
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(gt_to_xe(gt),
+				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		return -EIO;
 	}
 
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index f35ae3a532ee..ba1043476338 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -68,6 +68,7 @@
 #include "xe_uc_fw.h"
 #include "xe_vm.h"
 #include "xe_wa.h"
+#include "xe_wedge.h"
 #include "xe_wopcm.h"
 
 #define GRDOM_RESET_TIMEOUT_MS	5
@@ -933,7 +934,7 @@ static void gt_reset_worker(struct work_struct *w)
 	unsigned int fw_ref;
 	int err;
 
-	if (xe_device_wedged(gt_to_xe(gt)))
+	if (xe_wedged(gt_to_xe(gt)))
 		goto err_pm_put;
 
 	if (xe_device_is_in_reset(gt_to_xe(gt)))
@@ -992,8 +993,7 @@ static void gt_reset_worker(struct work_struct *w)
 
 err_fail:
 	xe_log_err_fatal(gt, GT, err, "reset failed\n");
-	xe_device_declare_wedged(gt_to_xe(gt),
-				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+	xe_wedge_declare(gt_to_xe(gt), DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 err_pm_put:
 	xe_pm_runtime_put(gt_to_xe(gt));
 }
@@ -1021,7 +1021,7 @@ static void gt_wedge_worker(struct work_struct *w)
 {
 	struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
 
-	xe_uc_declare_wedged(&gt->uc);
+	xe_uc_wedge_declare(&gt->uc);
 	xe_tlb_inval_reset(&gt->tlb_inval);
 }
 
@@ -1205,13 +1205,13 @@ struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
 }
 
 /**
- * xe_gt_declare_wedged() - Declare GT wedged
+ * xe_gt_wedge_declare() - Declare GT wedged
  * @gt: the GT object
  *
  * Wedge the GT which stops all submission, saves desired debug state, and
  * cleans up anything which could timeout.
  */
-void xe_gt_declare_wedged(struct xe_gt *gt)
+void xe_gt_wedge_declare(struct xe_gt *gt)
 {
 	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
 
diff --git a/drivers/gpu/drm/xe/xe_gt.h b/drivers/gpu/drm/xe/xe_gt.h
index 92d934d50244..7b6952fe804c 100644
--- a/drivers/gpu/drm/xe/xe_gt.h
+++ b/drivers/gpu/drm/xe/xe_gt.h
@@ -40,7 +40,7 @@ struct xe_gt *xe_gt_alloc(struct xe_tile *tile);
 int xe_gt_init_early(struct xe_gt *gt);
 int xe_gt_init(struct xe_gt *gt);
 void xe_gt_mmio_init(struct xe_gt *gt);
-void xe_gt_declare_wedged(struct xe_gt *gt);
+void xe_gt_wedge_declare(struct xe_gt *gt);
 int xe_gt_record_default_lrcs(struct xe_gt *gt);
 
 /**
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
index 28ec83bb8100..2a5f2064ad3e 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
@@ -37,6 +37,7 @@
 #include "xe_tile_sriov_vf.h"
 #include "xe_tlb_inval.h"
 #include "xe_uc_fw.h"
+#include "xe_wedge.h"
 #include "xe_wopcm.h"
 
 #define make_u64_from_u32(hi, lo) ((u64)((u64)(u32)(hi) << 32 | (u32)(lo)))
@@ -1462,7 +1463,7 @@ static void vf_post_migration_recovery(struct xe_gt *gt)
 fail:
 	vf_post_migration_abort(gt);
 	xe_gt_sriov_err(gt, "migration recovery failed (%pe)\n", ERR_PTR(err));
-	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 	return;
 
 queue:
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index 3ab4cb9e4964..7d239a0829fb 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -1829,13 +1829,13 @@ int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
 }
 
 /**
- * xe_guc_declare_wedged() - Declare GuC wedged
+ * xe_guc_wedge_declare() - Declare GuC wedged
  * @guc: the GuC object
  *
  * Wedge the GuC which stops all submission, saves desired debug state, and
  * cleans up anything which could timeout.
  */
-void xe_guc_declare_wedged(struct xe_guc *guc)
+void xe_guc_wedge_declare(struct xe_guc *guc)
 {
 	xe_gt_assert(guc_to_gt(guc), guc_to_xe(guc)->wedged.mode);
 
diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
index c4eca40d69cf..75c4b9acb065 100644
--- a/drivers/gpu/drm/xe/xe_guc.h
+++ b/drivers/gpu/drm/xe/xe_guc.h
@@ -62,7 +62,7 @@ void xe_guc_reset_wait(struct xe_guc *guc);
 void xe_guc_stop_prepare(struct xe_guc *guc);
 void xe_guc_stop(struct xe_guc *guc);
 int xe_guc_start(struct xe_guc *guc);
-void xe_guc_declare_wedged(struct xe_guc *guc);
+void xe_guc_wedge_declare(struct xe_guc *guc);
 bool xe_guc_using_main_gamctrl_queues(struct xe_guc *guc);
 bool xe_guc_has_paging_engine(struct xe_guc *guc);
 
diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index da5ce97484b8..7ab51c97f42a 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -36,6 +36,7 @@
 #include "xe_sleep.h"
 #include "xe_sriov_vf.h"
 #include "xe_trace_guc.h"
+#include "xe_wedge.h"
 
 static void receive_g2h(struct xe_guc_ct *ct);
 static void g2h_worker_func(struct work_struct *w);
@@ -1064,7 +1065,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_wedged(ct_to_xe(ct))) {
 		ret = -ENOTRECOVERABLE;
 		goto out;
 	}
@@ -1489,7 +1490,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
 	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;
+			ret = xe_wedged(ct_to_xe(ct)) ? -ENOTRECOVERABLE : -ECANCELED;
 			goto unlock;
 		}
 		xe_gt_err(gt, "H2G request %#x failed: error %#x hint %#x\n",
@@ -1828,7 +1829,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_wedged(xe))
 		return -ENOTRECOVERABLE;
 
 	if (ct->state == XE_GUC_CT_STATE_DISABLED)
diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index e0105222a2c7..9558d7196a51 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -36,6 +36,7 @@
 #include "xe_pm.h"
 #include "xe_sriov.h"
 #include "xe_wa.h"
+#include "xe_wedge.h"
 
 #define MCHBAR_MIRROR_BASE_SNB	0x140000
 
@@ -188,7 +189,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_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC reset failed: %pe\n",
 			  ERR_PTR(ret));
 
@@ -212,7 +213,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_wedged(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 +236,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_wedged(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 +258,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_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err(pc_to_gt(pc), "GuC PC unset param failed: %pe",
 			  ERR_PTR(ret));
 
@@ -1357,7 +1358,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_wedged(xe))
 		return;
 
 	xe_guc_pc_stop(pc);
diff --git a/drivers/gpu/drm/xe/xe_guc_rc.c b/drivers/gpu/drm/xe/xe_guc_rc.c
index 99fa127b261f..fa3062ab134a 100644
--- a/drivers/gpu/drm/xe/xe_guc_rc.c
+++ b/drivers/gpu/drm/xe/xe_guc_rc.c
@@ -16,6 +16,7 @@
 #include "xe_guc_pc.h"
 #include "xe_guc_rc.h"
 #include "xe_pm.h"
+#include "xe_wedge.h"
 
 /**
  * DOC: GuC RC (Render C-states)
@@ -40,7 +41,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_wedged(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 +74,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_wedged(xe))
 		return;
 
 	CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index e2a0b989cfc8..d03fe282c3c8 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -50,6 +50,7 @@
 #include "xe_trace.h"
 #include "xe_uc_fw.h"
 #include "xe_vm.h"
+#include "xe_wedge.h"
 
 #define XE_GUC_EXEC_QUEUE_CGP_CONTEXT_ERROR_LEN		6
 
@@ -1450,10 +1451,10 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc)
 	if (xe->wedged.mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
 		return false;
 
-	if (xe_device_wedged(xe))
+	if (xe_wedged(xe))
 		return true;
 
-	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 
 	return true;
 }
@@ -1660,7 +1661,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	if (!exec_queue_killed(q))
 		wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
 	else
-		wedged = xe_device_wedged(xe);
+		wedged = xe_wedged(xe);
 
 	/*
 	 * Only tag as GPU hang if this is the original timeout, not a
@@ -1780,8 +1781,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
 	}
 
 	if (wedge_device)
-		xe_device_declare_wedged(gt_to_xe(q->gt),
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(gt_to_xe(q->gt),
+				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 
 	/*
 	 * We want the job added back to the pending list so it gets freed; this
@@ -2544,7 +2545,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_wedged(xe))
 		return -EAGAIN;
 
 	if (!ret)
@@ -2804,7 +2805,7 @@ 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)) ||
+	wait_event(guc->ct.wq, xe_wedged(guc_to_xe(guc)) ||
 		   !xe_guc_read_stopped(guc));
 }
 
diff --git a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
index 111fef781b2a..dd38d95c6014 100644
--- a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
+++ b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
@@ -19,6 +19,7 @@
 #include "xe_sa.h"
 #include "xe_tlb_inval.h"
 #include "xe_vm.h"
+#include "xe_wedge.h"
 
 #include "regs/xe_guc_regs.h"
 
@@ -77,7 +78,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) && !xe_wedged(xe)) {
 		struct xe_mmio *mmio = &gt->mmio;
 
 		if (IS_SRIOV_VF(xe))
diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c
index 934be933d57f..a2eae6088c1a 100644
--- a/drivers/gpu/drm/xe/xe_mert.c
+++ b/drivers/gpu/drm/xe/xe_mert.c
@@ -11,6 +11,7 @@
 #include "xe_mmio.h"
 #include "xe_sriov_printk.h"
 #include "xe_tile.h"
+#include "xe_wedge.h"
 
 /**
  * xe_mert_init_early() - Initialize MERT data
@@ -74,8 +75,7 @@ static void mert_handle_cat_error(struct xe_device *xe)
 		break;
 	case CATERR_UNMAPPED_GGTT:
 		xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
-		xe_device_declare_wedged(xe,
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	case CATERR_LMTT_FAULT:
 		xe_sriov_dbg_ratelimited(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
@@ -83,8 +83,7 @@ static void mert_handle_cat_error(struct xe_device *xe)
 		break;
 	default:
 		xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
-		xe_device_declare_wedged(xe,
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		break;
 	}
 }
diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
index fdecd3e0b9a9..c64f403d1134 100644
--- a/drivers/gpu/drm/xe/xe_pci_error.c
+++ b/drivers/gpu/drm/xe/xe_pci_error.c
@@ -13,6 +13,7 @@
 #include "xe_printk.h"
 #include "xe_ras.h"
 #include "xe_survivability_mode.h"
+#include "xe_wedge.h"
 
 static void prepare_device_for_reset(struct pci_dev *pdev)
 {
@@ -22,7 +23,7 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
 
 	/*
 	 * 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
+	 * xe_wedge_fini() releases runtime pm if wedged flag is set, so acquire a runtime
 	 * pm reference to avoid underflow.
 	 */
 	if (!atomic_xchg(&xe->wedged.flag, 1))
@@ -31,7 +32,7 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
 	xe_device_set_in_reset(xe);
 
 	for_each_gt(gt, xe, id)
-		xe_gt_declare_wedged(gt);
+		xe_gt_wedge_declare(gt);
 
 	pci_disable_device(pdev);
 }
@@ -61,7 +62,7 @@ static pci_ers_result_t xe_pci_error_detected(struct pci_dev *pdev, pci_channel_
 		return PCI_ERS_RESULT_DISCONNECT;
 
 	/* If the device is already wedged or in survivability mode, do not attempt recovery */
-	if (xe_survivability_mode_is_boot_enabled(xe) || xe_device_wedged(xe))
+	if (xe_survivability_mode_is_boot_enabled(xe) || xe_wedged(xe))
 		return PCI_ERS_RESULT_DISCONNECT;
 
 	switch (state) {
@@ -86,8 +87,7 @@ static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev)
 
 	/* User wants to debug the error, prevent reset */
 	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
-		xe_device_declare_wedged(xe,
-					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
+		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
 		return PCI_ERS_RESULT_DISCONNECT;
 	}
 
diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index fe16a4106060..922e5e793b13 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -16,6 +16,7 @@
 #include "xe_sysctrl_event_types.h"
 #include "xe_sysctrl_mailbox.h"
 #include "xe_sysctrl_mailbox_types.h"
+#include "xe_wedge.h"
 
 #define CORE_COMPUTE_UNCORR_TYPE	GENMASK(26, 25)
 /*
@@ -321,7 +322,7 @@ static u8 handle_core_compute_errors(struct xe_ras_error_array *arr)
 
 static void punit_error_handler(struct xe_device *xe)
 {
-	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
+	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
 }
 
 static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_array *arr)
diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c
index 33bd754d138f..ce0db26203ec 100644
--- a/drivers/gpu/drm/xe/xe_sriov_pf.c
+++ b/drivers/gpu/drm/xe/xe_sriov_pf.c
@@ -19,6 +19,7 @@
 #include "xe_sriov_pf_service.h"
 #include "xe_sriov_pf_sysfs.h"
 #include "xe_sriov_printk.h"
+#include "xe_wedge.h"
 
 static unsigned int wanted_max_vfs(struct xe_device *xe)
 {
@@ -157,7 +158,7 @@ int xe_sriov_pf_wait_ready(struct xe_device *xe)
 	unsigned int id;
 	int err;
 
-	if (xe_device_wedged(xe))
+	if (xe_wedged(xe))
 		return -ECANCELED;
 
 	for_each_gt(gt, xe, id) {
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index ca031576fecb..d73cdad0b3a9 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -20,6 +20,7 @@
 #include "xe_pcode_api.h"
 #include "xe_printk.h"
 #include "xe_vsec.h"
+#include "xe_wedge.h"
 
 /**
  * DOC: Survivability Mode
@@ -446,7 +447,7 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
 	survivability->type = XE_SURVIVABILITY_TYPE_RUNTIME;
 	xe_log_err(xe, SURVIVABILITY, 0, "Runtime Mode enabled!\n");
 
-	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_VENDOR);
+	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_VENDOR);
 
 	xe_log_err(xe, SURVIVABILITY, 0, "Firmware flash required!\n");
 	xe_info(xe, "Please refer to the userspace documentation for more details how to flash the firmware on %s!\n",
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 65f59f06177f..686c28856014 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -326,15 +326,15 @@ void xe_uc_runtime_resume(struct xe_uc *uc)
 }
 
 /**
- * xe_uc_declare_wedged() - Declare UC wedged
+ * xe_uc_wedge_declare() - Declare UC wedged
  * @uc: the UC object
  *
  * Wedge the UC which stops all submission, saves desired debug state, and
  * cleans up anything which could timeout.
  */
-void xe_uc_declare_wedged(struct xe_uc *uc)
+void xe_uc_wedge_declare(struct xe_uc *uc)
 {
 	xe_gt_assert(uc_to_gt(uc), uc_to_xe(uc)->wedged.mode);
 
-	xe_guc_declare_wedged(&uc->guc);
+	xe_guc_wedge_declare(&uc->guc);
 }
diff --git a/drivers/gpu/drm/xe/xe_uc.h b/drivers/gpu/drm/xe/xe_uc.h
index 255a54a8f876..23bc0ce1c42f 100644
--- a/drivers/gpu/drm/xe/xe_uc.h
+++ b/drivers/gpu/drm/xe/xe_uc.h
@@ -21,6 +21,6 @@ int xe_uc_start(struct xe_uc *uc);
 void xe_uc_suspend_prepare(struct xe_uc *uc);
 int xe_uc_suspend(struct xe_uc *uc);
 int xe_uc_sanitize_reset(struct xe_uc *uc);
-void xe_uc_declare_wedged(struct xe_uc *uc);
+void xe_uc_wedge_declare(struct xe_uc *uc);
 
 #endif
diff --git a/drivers/gpu/drm/xe/xe_wedge.c b/drivers/gpu/drm/xe/xe_wedge.c
new file mode 100644
index 000000000000..93ca2d3c0c68
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_wedge.c
@@ -0,0 +1,261 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#include <drm/drm_drv.h>
+#include <drm/drm_managed.h>
+
+#include "xe_defaults.h"
+#include "xe_device.h"
+#include "xe_gt.h"
+#include "xe_gt_printk.h"
+#include "xe_guc_ads.h"
+#include "xe_log.h"
+#include "xe_module.h"
+#include "xe_pm.h"
+#include "xe_printk.h"
+#include "xe_sriov.h"
+#include "xe_wedge.h"
+
+/**
+ * DOC: Xe Device Wedging
+ *
+ * Xe driver uses drm device wedged uevent as documented in Documentation/gpu/drm-uapi.rst.
+ * When device is in wedged state, every IOCTL will be blocked and GT cannot
+ * be used. The conditions under which the driver declares the device wedged
+ * depend on the wedge mode configuration (see &enum xe_wedged_mode). The
+ * default recovery method for a wedged state is rebind/bus-reset.
+ *
+ * Another recovery method is vendor-specific. Below are the cases that send
+ * ``WEDGED=vendor-specific`` recovery method in drm device wedged uevent.
+ *
+ * Case: Firmware Flash
+ * --------------------
+ *
+ * Identification Hint
+ * +++++++++++++++++++
+ *
+ * ``WEDGED=vendor-specific`` drm device wedged uevent with
+ * :ref:`Runtime Survivability mode <xe-survivability-mode>` is used to notify
+ * admin/userspace consumer about the need for a firmware flash.
+ *
+ * Recovery Procedure
+ * ++++++++++++++++++
+ *
+ * Once ``WEDGED=vendor-specific`` drm device wedged uevent is received, follow
+ * the below steps
+ *
+ * - Check Runtime Survivability mode sysfs.
+ *   If enabled, firmware flash is required to recover the device.
+ *
+ *   /sys/bus/pci/devices/<device>/survivability_mode
+ *
+ * - Admin/userspace consumer can use firmware flashing tools like fwupd to flash
+ *   firmware and restore device to normal operation.
+ */
+
+/**
+ * xe_wedged() - Check for wedged device
+ * @xe: xe device instance
+ *
+ * Returns: %true if device is wedged, %false otherwise.
+ */
+bool xe_wedged(struct xe_device *xe)
+{
+	return atomic_read(&xe->wedged.flag);
+}
+
+#define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
+#define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
+
+/**
+ * xe_wedge_declare() - Declare device wedged
+ * @xe: xe device instance
+ * @method: method(s) to be used for recovery
+ *
+ * This is a final state that can only be cleared with the recovery method
+ * specified in the drm wedged uevent. The method can be set using
+ * xe_wedge_set_method() before declaring the device as wedged.
+ * If no method is set, rebind/bus-reset will be sent by default.
+ *
+ * In this state every IOCTL will be blocked so the GT cannot be used.
+ * In general it will be called upon any critical error such as gt reset
+ * failure or guc loading failure. Userspace will be notified of this state
+ * through device wedged uevent.
+ * If xe.wedged module parameter is set to 2, this function will be called
+ * on every single execution timeout (a.k.a. GPU hang) right after devcoredump
+ * snapshot capture. In this mode, GT reset won't be attempted so the state of
+ * the issue is preserved for further debugging.
+ *
+ * Caller is expected to hold a runtime PM reference to avoid side-effects
+ * during wedge handling.
+ */
+void xe_wedge_declare(struct xe_device *xe, unsigned long method)
+{
+	struct xe_gt *gt;
+	u8 id;
+
+	if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
+		xe_dbg(xe, "Wedged mode is forcibly disabled\n");
+		return;
+	}
+
+	if (atomic_xchg(&xe->wedged.flag, 1))
+		return;
+
+	xe->needs_flr_on_fini = true;
+	xe_pm_runtime_get_noresume(xe);
+
+	xe_log_err_fatal(xe, WEDGED, -EIO, "Device declared wedged!\n");
+	xe_err_once(xe, "IOCTLs and executions are now blocked!\n"
+			"For recovery procedure, refer to %s\n"
+			"Please file a _new_ bug report at %s\n",
+			WEDGED_URL, XE_BUG_URL);
+
+	for_each_initialized_gt(gt, xe, id)
+		xe_gt_wedge_declare(gt);
+
+	/*
+	 * XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET is intended for debugging
+	 * hangs, so wedge the device with 'none' recovery method and have
+	 * it available to the user for debugging.
+	 */
+	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
+		method = DRM_WEDGE_RECOVERY_NONE;
+
+	/* Notify userspace of wedged device */
+	drm_dev_wedged_event(&xe->drm, method, NULL);
+}
+
+static const char *wedge_mode_to_string(enum xe_wedged_mode mode)
+{
+	switch (mode) {
+	case XE_WEDGED_MODE_NEVER:
+		return "never";
+	case XE_WEDGED_MODE_UPON_CRITICAL_ERROR:
+		return "upon-critical-error";
+	case XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET:
+		return "upon-any-hang-no-reset";
+	default:
+		return "<invalid>";
+	}
+}
+
+static int wedge_validate_mode(struct xe_device *xe, unsigned int mode)
+{
+	if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
+		xe_dbg(xe, "wedged_mode: invalid value (%u)\n", mode);
+		return -EINVAL;
+	} else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
+		   (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
+		xe_dbg(xe, "wedged_mode: (%u) %s mode is not supported for %s\n",
+		       mode, wedge_mode_to_string(mode),
+		       xe_sriov_mode_to_string(xe_device_sriov_mode(xe)));
+		return -EPERM;
+	}
+
+	return 0;
+}
+
+static bool wedge_mode_needs_policy_update(struct xe_device *xe, enum xe_wedged_mode mode)
+{
+	if (xe->wedged.inconsistent_reset)
+		return true;
+
+	if (xe->wedged.mode == mode)
+		return false;
+
+	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET ||
+	    mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
+		return true;
+
+	return false;
+}
+
+static int __wedge_mode_set_reset_policy(struct xe_gt *gt, enum xe_wedged_mode mode)
+{
+	bool enable_engine_reset;
+	int ret;
+
+	enable_engine_reset = (mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET);
+	ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads,
+						       enable_engine_reset);
+	if (ret)
+		xe_gt_err(gt, "Failed to update GuC ADS scheduler policy (%pe)\n", ERR_PTR(ret));
+
+	return ret;
+}
+
+static int wedge_mode_set_reset_policy(struct xe_device *xe, enum xe_wedged_mode mode)
+{
+	struct xe_gt *gt;
+	int ret;
+	u8 id;
+
+	guard(xe_pm_runtime)(xe);
+	for_each_gt(gt, xe, id) {
+		ret = __wedge_mode_set_reset_policy(gt, mode);
+		if (ret) {
+			if (id > 0) {
+				xe->wedged.inconsistent_reset = true;
+				xe_err(xe, "Inconsistent reset policy state between GTs\n");
+			}
+			return ret;
+		}
+	}
+
+	xe->wedged.inconsistent_reset = false;
+
+	return 0;
+}
+
+/**
+ * xe_wedge_set_mode() - Set wedge mode
+ * @xe: xe device instance
+ * @mode: wedge mode to be set
+ *
+ * Returns: 0 on success, negative error code otherwise.
+ */
+int xe_wedge_set_mode(struct xe_device *xe, enum xe_wedged_mode mode)
+{
+	int ret;
+
+	ret = wedge_validate_mode(xe, mode);
+	if (ret)
+		return ret;
+
+	if (wedge_mode_needs_policy_update(xe, mode)) {
+		ret = wedge_mode_set_reset_policy(xe, mode);
+		if (ret)
+			return ret;
+	}
+
+	xe->wedged.mode = mode;
+
+	return ret;
+}
+
+static void xe_wedge_fini(struct drm_device *drm, void *arg)
+{
+	struct xe_device *xe = arg;
+
+	if (atomic_read(&xe->wedged.flag))
+		xe_pm_runtime_put(xe);
+}
+
+/**
+ * xe_wedge_init() - Initialize wedge
+ * @xe: xe device instance
+ *
+ * Returns: 0 on success, negative error code otherwise.
+ */
+int xe_wedge_init(struct xe_device *xe)
+{
+	xe->wedged.mode = wedge_validate_mode(xe, xe_modparam.wedged_mode) ?
+			  XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
+	xe_dbg(xe, "wedged_mode: setting mode (%u) %s\n",
+	       xe->wedged.mode, wedge_mode_to_string(xe->wedged.mode));
+
+	return drmm_add_action_or_reset(&xe->drm, xe_wedge_fini, xe);
+}
diff --git a/drivers/gpu/drm/xe/xe_wedge.h b/drivers/gpu/drm/xe/xe_wedge.h
new file mode 100644
index 000000000000..5fda8ce015d4
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_wedge.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _XE_WEDGE_H_
+#define _XE_WEDGE_H_
+
+#include <linux/types.h>
+
+struct xe_device;
+enum xe_wedged_mode;
+
+bool xe_wedged(struct xe_device *xe);
+void xe_wedge_declare(struct xe_device *xe, unsigned long method);
+int xe_wedge_init(struct xe_device *xe);
+int xe_wedge_set_mode(struct xe_device *xe, enum xe_wedged_mode mode);
+
+#endif
diff --git a/drivers/gpu/drm/xe/xe_wedge_types.h b/drivers/gpu/drm/xe/xe_wedge_types.h
new file mode 100644
index 000000000000..1b66df31013e
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_wedge_types.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _XE_WEDGE_TYPES_H_
+#define _XE_WEDGE_TYPES_H_
+
+#include <linux/types.h>
+
+/**
+ * enum xe_wedged_mode - Possible wedge modes
+ * @XE_WEDGED_MODE_NEVER: Device will never be declared wedged.
+ * @XE_WEDGED_MODE_UPON_CRITICAL_ERROR: Device will be declared wedged only
+ *	when critical error occurs like GT reset failure or firmware failure.
+ *	This is the default mode.
+ * @XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET: Device will be declared wedged on
+ *	any hang. In this mode, engine resets are disabled to avoid automatic
+ *	recovery attempts. This mode is primarily intended for debugging hangs.
+ */
+enum xe_wedged_mode {
+	XE_WEDGED_MODE_NEVER = 0,
+	XE_WEDGED_MODE_UPON_CRITICAL_ERROR = 1,
+	XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
+};
+
+/**
+ * struct xe_wedge - Struct to control Wedged States and mode
+ */
+struct xe_wedge {
+	/** @flag: Xe device faced a critical error and is now blocked. */
+	atomic_t flag;
+	/** @mode: Mode controlled by kernel parameter and debugfs */
+	enum xe_wedged_mode mode;
+	/** @inconsistent_reset: Inconsistent reset policy state between GTs */
+	bool inconsistent_reset;
+};
+
+#endif
-- 
2.43.0


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

* [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
                   ` (3 preceding siblings ...)
  2026-10-13 11:03 ` [PATCH v5 4/5] drm/xe: Introduce xe_wedge Raag Jadav
@ 2026-10-13 11:03 ` Raag Jadav
  2026-10-13 11:22   ` sashiko-bot
  2026-10-13 11:12 ` ✗ CI.checkpatch: warning for Introduce xe_wedge (rev4) Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Raag Jadav @ 2026-10-13 11:03 UTC (permalink / raw)
  To: intel-xe
  Cc: riana.tauro, michal.wajdeczko, lukasz.laguna, matthew.d.roper,
	matthew.brost, mallesh.koujalagi, rodrigo.vivi, Raag Jadav

With xe_wedge_fini() now moved to xe_wedge and registered as part of
xe_device_probe_early(), it is safe to move xe_ras_process_errors() back
to xe_ras where it belongs. This essentially reverts commit 20bc4883c7c0
("drm/xe/ras: Fix boot-time ras error processing"), which was added to
prevent PM reference leak in case of early wedging in probe sequence.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 7 -------
 drivers/gpu/drm/xe/xe_ras.c    | 7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index e0466390219c..a6bcb82b115f 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1087,13 +1087,6 @@ int xe_device_probe(struct xe_device *xe)
 
 	detect_preproduction_hw(xe);
 
-	/*
-	 * Process and log any errors detected by hardware. Possible results can
-	 * include declaring the device as wedged, which must be done only after
-	 * xe_wedge_fini() is registered.
-	 */
-	xe_ras_process_errors(xe);
-
 	err = devm_add_action_or_reset(xe->drm.dev, xe_device_sanitize, xe);
 	if (err)
 		goto err_unregister_display;
diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 922e5e793b13..8e399ffec985 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -932,6 +932,13 @@ void xe_ras_init(struct xe_device *xe)
 	if (IS_ENABLED(CONFIG_PCIEAER))
 		ras_usp_aer_init(xe);
 
+	/*
+	 * During probe, process and log any errors detected by firmware while the driver was not
+	 * loaded. Critical errors such as Punit and CSC are reported through Pcode init failure,
+	 * causing the driver to enter survivability mode.
+	 */
+	xe_ras_process_errors(xe);
+
 	ret = devm_device_add_group(xe->drm.dev, &gpu_health_group);
 	if (ret)
 		xe_err(xe, "Failed to create GPU health sysfs, err=%d\n", ret);
-- 
2.43.0


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

* ✗ CI.checkpatch: warning for Introduce xe_wedge (rev4)
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
                   ` (4 preceding siblings ...)
  2026-10-13 11:03 ` [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
@ 2026-10-13 11:12 ` Patchwork
  2026-10-13 11:14 ` ✓ CI.KUnit: success " Patchwork
  2026-10-13 15:40 ` ✓ Xe.CI.BAT: " Patchwork
  7 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-10-13 11:12 UTC (permalink / raw)
  To: Raag Jadav; +Cc: intel-xe

== Series Details ==

Series: Introduce xe_wedge (rev4)
URL   : https://patchwork.freedesktop.org/series/173011/
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
6bef5ce5c74dc76b4ee69ab2832c0d1fd63c91c7
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit ee05467e14ea674530122e1a4dcabf175a79623f
Author: Raag Jadav <raag.jadav@intel.com>
Date:   Tue Oct 13 16:33:57 2026 +0530

    drm/xe/ras: Move xe_ras_process_errors() to xe_ras
    
    With xe_wedge_fini() now moved to xe_wedge and registered as part of
    xe_device_probe_early(), it is safe to move xe_ras_process_errors() back
    to xe_ras where it belongs. This essentially reverts commit 20bc4883c7c0
    ("drm/xe/ras: Fix boot-time ras error processing"), which was added to
    prevent PM reference leak in case of early wedging in probe sequence.
    
    Signed-off-by: Raag Jadav <raag.jadav@intel.com>
    Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
+ /mt/dim checkpatch f70a5a920a49326b4b953fe6f756586c21e3fbeb drm-intel
94109e0eaafc drm/xe/gt: Use GT ordered workqueue for wedging
-:43: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#43: FILE: drivers/gpu/drm/xe/xe_device.h:142:
+#define for_each_initialized_gt(gt__, xe__, id__) \
+	for_each_gt((gt__), (xe__), (id__)) \
+		for_each_if(READ_ONCE((gt__)->initialized))

BUT SEE:

   do {} while (0) advice is over-stated in a few situations:

   The more obvious case is macros, like MODULE_PARM_DESC, invoked at
   file-scope, where C disallows code (it must be in functions).  See
   $exceptions if you have one to add by name.

   More troublesome is declarative macros used at top of new scope,
   like DECLARE_PER_CPU.  These might just compile with a do-while-0
   wrapper, but would be incorrect.  Most of these are handled by
   detecting struct,union,etc declaration primitives in $exceptions.

   Theres also macros called inside an if (block), which "return" an
   expression.  These cannot do-while, and need a ({}) wrapper.

   Enjoy this qualification while we work to improve our heuristics.

-:43: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'gt__' - possible side-effects?
#43: FILE: drivers/gpu/drm/xe/xe_device.h:142:
+#define for_each_initialized_gt(gt__, xe__, id__) \
+	for_each_gt((gt__), (xe__), (id__)) \
+		for_each_if(READ_ONCE((gt__)->initialized))

total: 1 errors, 0 warnings, 1 checks, 91 lines checked
2259f5577934 drm/xe: Drop xe_device_set_wedged_method()
933790b24079 drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early()
92e976e2780f drm/xe: Introduce xe_wedge
-:1055: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#1055: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 1176 lines checked
ee05467e14ea drm/xe/ras: Move xe_ras_process_errors() to xe_ras



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

* ✓ CI.KUnit: success for Introduce xe_wedge (rev4)
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
                   ` (5 preceding siblings ...)
  2026-10-13 11:12 ` ✗ CI.checkpatch: warning for Introduce xe_wedge (rev4) Patchwork
@ 2026-10-13 11:14 ` Patchwork
  2026-10-13 15:40 ` ✓ Xe.CI.BAT: " Patchwork
  7 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-10-13 11:14 UTC (permalink / raw)
  To: Raag Jadav; +Cc: intel-xe

== Series Details ==

Series: Introduce xe_wedge (rev4)
URL   : https://patchwork.freedesktop.org/series/173011/
State : success

== Summary ==

+ trap cleanup EXIT
+ kunitconfigs=('/kernel/drivers/gpu/tests/.kunitconfig' '/kernel/drivers/gpu/drm/xe/.kunitconfig' '/kernel/drivers/gpu/drm/tests/.kunitconfig' '/kernel/drivers/gpu/drm/ttm/tests/.kunitconfig' '/kernel/drivers/dma-buf/.kunitconfig')
+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/tests/.kunitconfig
[11:12:08] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[11:12:13] 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
[11:12:33] Starting KUnit Kernel (1/1)...
[11:12:33] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[11:12:33] ================= gpu_buddy (14 subtests) ==================
[11:12:33] [PASSED] gpu_test_buddy_alloc_limit
[11:12:33] [PASSED] gpu_test_buddy_alloc_optimistic
[11:12:33] [PASSED] gpu_test_buddy_alloc_pessimistic
[11:12:33] [PASSED] gpu_test_buddy_alloc_pathological
[11:12:33] [PASSED] gpu_test_buddy_alloc_contiguous
[11:12:33] [PASSED] gpu_test_buddy_alloc_clear
[11:12:33] [PASSED] gpu_test_buddy_alloc_range
[11:12:34] [PASSED] gpu_test_buddy_alloc_range_bias
[11:12:35] [PASSED] gpu_test_buddy_fragmentation_performance
[11:12:35] [PASSED] gpu_test_buddy_dirty_tracker_performance
[11:12:35] [PASSED] gpu_test_buddy_alloc_exceeds_max_order
[11:12:35] [PASSED] gpu_test_buddy_offset_aligned_allocation
[11:12:35] [PASSED] gpu_test_buddy_subtree_offset_alignment_stress
[11:12:35] [PASSED] gpu_test_buddy_addr_to_block
[11:12:35] ==================== [PASSED] gpu_buddy ====================
[11:12:35] ============================================================
[11:12:35] Testing complete. Ran 14 tests: passed: 14
[11:12:35] Elapsed time: 27.221s total, 4.494s configuring, 20.809s building, 1.845s running

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

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

+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig
[11:13:39] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[11:13:41] 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
[11:13:51] Starting KUnit Kernel (1/1)...
[11:13:51] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[11:13:52] ================= ttm_device (5 subtests) ==================
[11:13:52] [PASSED] ttm_device_init_basic
[11:13:52] [PASSED] ttm_device_init_multiple
[11:13:52] [PASSED] ttm_device_fini_basic
[11:13:52] [PASSED] ttm_device_init_no_vma_man
[11:13:52] ================== ttm_device_init_pools  ==================
[11:13:52] [PASSED] No DMA allocations, no DMA32 required
[11:13:52] [PASSED] DMA allocations, DMA32 required
[11:13:52] [PASSED] No DMA allocations, DMA32 required
[11:13:52] [PASSED] DMA allocations, no DMA32 required
[11:13:52] ============== [PASSED] ttm_device_init_pools ==============
[11:13:52] =================== [PASSED] ttm_device ====================
[11:13:52] ================== ttm_pool (8 subtests) ===================
[11:13:52] ================== ttm_pool_alloc_basic  ===================
[11:13:52] [PASSED] One page
[11:13:52] [PASSED] More than one page
[11:13:52] [PASSED] Above the allocation limit
[11:13:52] [PASSED] One page, with coherent DMA mappings enabled
[11:13:52] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[11:13:52] ============== [PASSED] ttm_pool_alloc_basic ===============
[11:13:52] ============== ttm_pool_alloc_basic_dma_addr  ==============
[11:13:52] [PASSED] One page
[11:13:52] [PASSED] More than one page
[11:13:52] [PASSED] Above the allocation limit
[11:13:52] [PASSED] One page, with coherent DMA mappings enabled
[11:13:52] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[11:13:52] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[11:13:52] [PASSED] ttm_pool_alloc_order_caching_match
[11:13:52] [PASSED] ttm_pool_alloc_caching_mismatch
[11:13:52] [PASSED] ttm_pool_alloc_order_mismatch
[11:13:52] [PASSED] ttm_pool_free_dma_alloc
[11:13:52] [PASSED] ttm_pool_free_no_dma_alloc
[11:13:52] [PASSED] ttm_pool_fini_basic
[11:13:52] ==================== [PASSED] ttm_pool =====================
[11:13:52] ================ ttm_resource (8 subtests) =================
[11:13:52] ================= ttm_resource_init_basic  =================
[11:13:52] [PASSED] Init resource in TTM_PL_SYSTEM
[11:13:52] [PASSED] Init resource in TTM_PL_VRAM
[11:13:52] [PASSED] Init resource in a private placement
[11:13:52] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[11:13:52] ============= [PASSED] ttm_resource_init_basic =============
[11:13:52] [PASSED] ttm_resource_init_pinned
[11:13:52] [PASSED] ttm_resource_fini_basic
[11:13:52] [PASSED] ttm_resource_manager_init_basic
[11:13:52] [PASSED] ttm_resource_manager_usage_basic
[11:13:52] [PASSED] ttm_resource_manager_set_used_basic
[11:13:52] [PASSED] ttm_sys_man_alloc_basic
[11:13:52] [PASSED] ttm_sys_man_free_basic
[11:13:52] ================== [PASSED] ttm_resource ===================
[11:13:52] =================== ttm_tt (15 subtests) ===================
[11:13:52] ==================== ttm_tt_init_basic  ====================
[11:13:52] [PASSED] Page-aligned size
[11:13:52] [PASSED] Extra pages requested
[11:13:52] ================ [PASSED] ttm_tt_init_basic ================
[11:13:52] [PASSED] ttm_tt_init_misaligned
[11:13:52] [PASSED] ttm_tt_fini_basic
[11:13:52] [PASSED] ttm_tt_fini_sg
[11:13:52] [PASSED] ttm_tt_fini_shmem
[11:13:52] [PASSED] ttm_tt_create_basic
[11:13:52] [PASSED] ttm_tt_create_invalid_bo_type
[11:13:52] [PASSED] ttm_tt_create_ttm_exists
[11:13:52] [PASSED] ttm_tt_create_failed
[11:13:52] [PASSED] ttm_tt_destroy_basic
[11:13:52] [PASSED] ttm_tt_populate_null_ttm
[11:13:52] [PASSED] ttm_tt_populate_populated_ttm
[11:13:52] [PASSED] ttm_tt_unpopulate_basic
[11:13:52] [PASSED] ttm_tt_unpopulate_empty_ttm
[11:13:52] [PASSED] ttm_tt_swapin_basic
[11:13:52] ===================== [PASSED] ttm_tt ======================
[11:13:52] =================== ttm_bo (14 subtests) ===================
[11:13:52] =========== ttm_bo_reserve_optimistic_no_ticket  ===========
[11:13:52] [PASSED] Cannot be interrupted and sleeps
[11:13:52] [PASSED] Cannot be interrupted, locks straight away
[11:13:52] [PASSED] Can be interrupted, sleeps
[11:13:52] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[11:13:52] [PASSED] ttm_bo_reserve_locked_no_sleep
[11:13:52] [PASSED] ttm_bo_reserve_no_wait_ticket
[11:13:52] [PASSED] ttm_bo_reserve_double_resv
[11:13:52] [PASSED] ttm_bo_reserve_interrupted
[11:13:52] [PASSED] ttm_bo_reserve_deadlock
[11:13:52] [PASSED] ttm_bo_unreserve_basic
[11:13:52] [PASSED] ttm_bo_unreserve_pinned
[11:13:52] [PASSED] ttm_bo_unreserve_bulk
[11:13:52] [PASSED] ttm_bo_fini_basic
[11:13:52] [PASSED] ttm_bo_fini_shared_resv
[11:13:52] [PASSED] ttm_bo_pin_basic
[11:13:52] [PASSED] ttm_bo_pin_unpin_resource
[11:13:52] [PASSED] ttm_bo_multiple_pin_one_unpin
[11:13:52] ===================== [PASSED] ttm_bo ======================
[11:13:52] ============== ttm_bo_validate (22 subtests) ===============
[11:13:52] ============== ttm_bo_init_reserved_sys_man  ===============
[11:13:52] [PASSED] Buffer object for userspace
[11:13:52] [PASSED] Kernel buffer object
[11:13:52] [PASSED] Shared buffer object
[11:13:52] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[11:13:52] ============== ttm_bo_init_reserved_mock_man  ==============
[11:13:52] [PASSED] Buffer object for userspace
[11:13:52] [PASSED] Kernel buffer object
[11:13:52] [PASSED] Shared buffer object
[11:13:52] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[11:13:52] [PASSED] ttm_bo_init_reserved_resv
[11:13:52] ================== ttm_bo_validate_basic  ==================
[11:13:52] [PASSED] Buffer object for userspace
[11:13:52] [PASSED] Kernel buffer object
[11:13:52] [PASSED] Shared buffer object
[11:13:52] ============== [PASSED] ttm_bo_validate_basic ==============
[11:13:52] [PASSED] ttm_bo_validate_invalid_placement
[11:13:52] ============= ttm_bo_validate_same_placement  ==============
[11:13:52] [PASSED] System manager
[11:13:52] [PASSED] VRAM manager
[11:13:52] ========= [PASSED] ttm_bo_validate_same_placement ==========
[11:13:52] [PASSED] ttm_bo_validate_failed_alloc
[11:13:52] [PASSED] ttm_bo_validate_pinned
[11:13:52] [PASSED] ttm_bo_validate_busy_placement
[11:13:52] ================ ttm_bo_validate_multihop  =================
[11:13:52] [PASSED] Buffer object for userspace
[11:13:52] [PASSED] Kernel buffer object
[11:13:52] [PASSED] Shared buffer object
[11:13:52] ============ [PASSED] ttm_bo_validate_multihop =============
[11:13:52] ========== ttm_bo_validate_no_placement_signaled  ==========
[11:13:52] [PASSED] Buffer object in system domain, no page vector
[11:13:52] [PASSED] Buffer object in system domain with an existing page vector
[11:13:52] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[11:13:52] ======== ttm_bo_validate_no_placement_not_signaled  ========
[11:13:52] [PASSED] Buffer object for userspace
[11:13:52] [PASSED] Kernel buffer object
[11:13:52] [PASSED] Shared buffer object
[11:13:52] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[11:13:52] [PASSED] ttm_bo_validate_move_fence_signaled
[11:13:52] ========= ttm_bo_validate_move_fence_not_signaled  =========
[11:13:52] [PASSED] Waits for GPU
[11:13:52] [PASSED] Tries to lock straight away
[11:13:52] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[11:13:52] [PASSED] ttm_bo_validate_swapout
[11:13:52] [PASSED] ttm_bo_validate_happy_evict
[11:13:52] [PASSED] ttm_bo_validate_all_pinned_evict
[11:13:52] [PASSED] ttm_bo_validate_allowed_only_evict
[11:13:52] [PASSED] ttm_bo_validate_deleted_evict
[11:13:52] [PASSED] ttm_bo_validate_busy_domain_evict
[11:13:52] [PASSED] ttm_bo_validate_evict_gutting
[11:13:52] [PASSED] ttm_bo_validate_recrusive_evict
[11:13:52] ================= [PASSED] ttm_bo_validate =================
[11:13:52] ============================================================
[11:13:52] Testing complete. Ran 102 tests: passed: 102
[11:13:52] Elapsed time: 12.370s total, 1.891s configuring, 10.264s building, 0.186s running

+ for kcfg in "${kunitconfigs[@]}"
+ [[ ! -f /kernel/drivers/dma-buf/.kunitconfig ]]
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/dma-buf/.kunitconfig
[11:13:52] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[11:13:54] 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
[11:14:02] Starting KUnit Kernel (1/1)...
[11:14:02] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[11:14:03] =============== dma-buf-fence (12 subtests) ================
[11:14:03] [PASSED] test_sanitycheck
[11:14:03] [PASSED] test_signaling
[11:14:03] [PASSED] test_add_callback
[11:14:03] [PASSED] test_late_add_callback
[11:14:03] [PASSED] test_rm_callback
[11:14:03] [PASSED] test_late_rm_callback
[11:14:03] [PASSED] test_status
[11:14:03] [PASSED] test_error
[11:14:03] [PASSED] test_wait
[11:14:03] [PASSED] test_wait_timeout
[11:14:03] [PASSED] test_stub
[11:14:03] [SKIPPED] test_race_signal_callback (requires at least 2 CPUs)
[11:14:03] ================== [PASSED] dma-buf-fence ==================
[11:14:03] ============ dma-buf-fence-chain (11 subtests) =============
[11:14:03] [PASSED] test_sanitycheck
[11:14:03] [PASSED] test_find_seqno
[11:14:03] [PASSED] test_find_signaled
[11:14:03] [PASSED] test_find_out_of_order
[11:14:08] [PASSED] test_find_gap
[11:14:08] [PASSED] test_find_race
[11:14:08] [PASSED] test_signal_forward
[11:14:08] [PASSED] test_signal_backward
[11:14:08] [PASSED] test_wait_forward
[11:14:08] [PASSED] test_wait_backward
[11:14:08] [PASSED] test_wait_random
[11:14:08] =============== [PASSED] dma-buf-fence-chain ===============
[11:14:08] ============ dma-buf-fence-unwrap (10 subtests) ============
[11:14:08] [PASSED] test_sanitycheck
[11:14:08] [PASSED] test_unwrap_array
[11:14:08] [PASSED] test_unwrap_chain
[11:14:08] [PASSED] test_unwrap_chain_array
[11:14:08] [PASSED] test_unwrap_merge
[11:14:08] [PASSED] test_unwrap_merge_duplicate
[11:14:08] [PASSED] test_unwrap_merge_seqno
[11:14:08] [PASSED] test_unwrap_merge_order
[11:14:08] [PASSED] test_unwrap_merge_complex
[11:14:08] [PASSED] test_unwrap_merge_complex_seqno
[11:14:08] ============== [PASSED] dma-buf-fence-unwrap ===============
[11:14:08] ================ dma-buf-resv (5 subtests) =================
[11:14:08] [PASSED] test_sanitycheck
[11:14:08] ===================== test_signaling  ======================
[11:14:08] [PASSED] kernel
[11:14:08] [PASSED] write
[11:14:08] [PASSED] read
[11:14:08] [PASSED] bookkeep
[11:14:08] ================= [PASSED] test_signaling ==================
[11:14:08] ====================== test_for_each  ======================
[11:14:08] [PASSED] kernel
[11:14:08] [PASSED] write
[11:14:08] [PASSED] read
[11:14:08] [PASSED] bookkeep
[11:14:08] ================== [PASSED] test_for_each ==================
[11:14:08] ================= test_for_each_unlocked  ==================
[11:14:08] [PASSED] kernel
[11:14:08] [PASSED] write
[11:14:08] [PASSED] read
[11:14:08] [PASSED] bookkeep
[11:14:08] ============= [PASSED] test_for_each_unlocked ==============
[11:14:08] ===================== test_get_fences  =====================
[11:14:08] [PASSED] kernel
[11:14:08] [PASSED] write
[11:14:08] [PASSED] read
[11:14:08] [PASSED] bookkeep
[11:14:08] ================= [PASSED] test_get_fences =================
[11:14:08] ================== [PASSED] dma-buf-resv ===================
[11:14:08] ============================================================
[11:14:08] Testing complete. Ran 50 tests: passed: 49, skipped: 1
[11:14:08] Elapsed time: 16.052s total, 1.888s configuring, 8.794s building, 5.338s running

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



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

* Re: [PATCH v5 4/5] drm/xe: Introduce xe_wedge
  2026-10-13 11:03 ` [PATCH v5 4/5] drm/xe: Introduce xe_wedge Raag Jadav
@ 2026-10-13 11:16   ` sashiko-bot
  2026-10-13 18:32   ` Rodrigo Vivi
  1 sibling, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-10-13 11:16 UTC (permalink / raw)
  To: Raag Jadav, intel-xe

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] workqueue: deadlock in xe_gt_wedge_declare via ordered_wq self-blocking
- [High] locking: flush_work() called from hardirq context in xe_mert_irq_handler
- [Low] build: incomplete enum xe_wedged_mode passed by value in header
--

commit ef60a972f78fff1500b565b78fe1b7a7fdd9918d
Author: Raag Jadav <raag.jadav@intel.com>

drm/xe: Introduce xe_wedge

Consolidate wedging implementation into a dedicated xe_wedge component
for better maintainability. While at it, rename all wedge helpers
to match with component name.

> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 775c826b68b42..ba10434763381 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
[ ... ]
> @@ -986,7 +993,7 @@ static void gt_reset_worker(struct work_struct *w)
>  
>  err_fail:
>  	xe_log_err_fatal(gt, GT, err, "reset failed\n");
> -	xe_device_declare_wedged(gt_to_xe(gt));
> +	xe_wedge_declare(gt_to_xe(gt), DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);

[Severity: High]
Can this sequence cause a deadlock? The gt_reset_worker is already executing
on the gt->ordered_wq workqueue. Calling xe_wedge_declare() eventually calls
xe_gt_wedge_declare() which queues gt->wedge.worker to the same ordered_wq
and then calls flush_work(). If the ordered workqueue has max_active=1, won't
it block permanently waiting for the newly queued item? A similar situation
exists in vf_post_migration_recovery().

>  err_pm_put:
>  	xe_pm_runtime_put(gt_to_xe(gt));
>  }
[ ... ]
> @@ -1190,16 +1205,16 @@ struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
>  }
>  
>  /**
> - * xe_gt_declare_wedged() - Declare GT wedged
> + * xe_gt_wedge_declare() - Declare GT wedged
>   * @gt: the GT object
>   *
>   * Wedge the GT which stops all submission, saves desired debug state, and
>   * cleans up anything which could timeout.
>   */
> -void xe_gt_declare_wedged(struct xe_gt *gt)
> +void xe_gt_wedge_declare(struct xe_gt *gt)
>  {
>  	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
>  
> -	xe_uc_declare_wedged(&gt->uc);
> -	xe_tlb_inval_reset(&gt->tlb_inval);
> +	queue_work(gt->ordered_wq, &gt->wedge.worker);
> +	flush_work(&gt->wedge.worker);

[Severity: High]
Does this flush_work() execute in hardirq context? The function
xe_mert_irq_handler() in xe_mert.c runs in hardirq context and calls
mert_handle_cat_error(), which calls xe_wedge_declare(), ultimately leading
here. Calling a sleeping function from atomic context will cause issues.

>  }
> diff --git a/drivers/gpu/drm/xe/xe_wedge.h b/drivers/gpu/drm/xe/xe_wedge.h
> new file mode 100644
> index 0000000000000..5fda8ce015d49
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_wedge.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_WEDGE_H_
> +#define _XE_WEDGE_H_
> +
> +#include <linux/types.h>
> +
> +struct xe_device;
> +enum xe_wedged_mode;
> +
> +bool xe_wedged(struct xe_device *xe);
> +void xe_wedge_declare(struct xe_device *xe, unsigned long method);
> +int xe_wedge_init(struct xe_device *xe);
> +int xe_wedge_set_mode(struct xe_device *xe, enum xe_wedged_mode mode);

[Severity: Low]
Is this prototype valid according to the C standard? The incomplete enum
xe_wedged_mode is being passed by value. Including xe_wedge_types.h directly
should resolve this build issue.

> +
> +#endif

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013110439.181447-1-raag.jadav@intel.com?part=4

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

* Re: [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging
  2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
@ 2026-10-13 11:19   ` sashiko-bot
  2026-10-13 18:29   ` Rodrigo Vivi
  1 sibling, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-10-13 11:19 UTC (permalink / raw)
  To: Raag Jadav, intel-xe

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] workqueue: self-deadlock in xe_gt_declare_wedged() when invoked from ordered_wq workers
- [High] xe: sleeping in atomic context via flush_work in xe_gt_declare_wedged
- [High] drm/xe: missing memory barriers when publishing gt->initialized allows workqueue corruption
--

commit f7181376c2cff07d590f539fd01106cc19cb1c8f
Author: Raag Jadav <raag.jadav@intel.com>

drm/xe/gt: Use GT ordered workqueue for wedging
    
This commit introduces a worker for GT-specific wedge handling and queues it
on the GT ordered workqueue to prevent disrupting the scheduler while jobs are
in-flight. It also introduces the for_each_initialized_gt() macro to avoid
races during probe sequences.

> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -139,6 +139,10 @@ static inline bool xe_device_uc_enabled(struct xe_device *xe)
>  	for_each_gt((gt__), (tile__)->xe, (id__)) \
>  		for_each_if((gt__)->tile == (tile__))
>  
> +#define for_each_initialized_gt(gt__, xe__, id__) \
> +	for_each_gt((gt__), (xe__), (id__)) \
> +		for_each_if(READ_ONCE((gt__)->initialized))

[Severity: High]
Does this missing acquire memory barrier allow workqueue corruption?

If a hardware error or AMC alert triggers device wedging on a different CPU
concurrently with xe_gt_init(), the for_each_initialized_gt() macro checks
this flag. However, READ_ONCE() does not emit memory barriers on all
architectures. 

On weakly-ordered CPUs (like ARM64), a concurrent reader's speculative loads
could be hoisted before the gt->initialized check completes, causing
xe_gt_declare_wedged() to invoke queue_work() on an uninitialized workqueue or
work struct.

Should this use smp_load_acquire() and smp_store_release() to guarantee
proper ordering?

> +
>  static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
>  {
>  	return &gt->pm.fw;

[ ... ]

> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c

[ ... ]

> @@ -769,6 +773,8 @@ int xe_gt_init(struct xe_gt *gt)
>  			return err;
>  	}
>  
> +	/* Must be last */
> +	WRITE_ONCE(gt->initialized, true);

[Severity: High]
Similar to the read side, WRITE_ONCE() lacks a release memory barrier. The
CPU could reorder this store before the INIT_WORK(&gt->wedge.worker) store
earlier in xe_gt_init(). Replacing this with smp_store_release() would
ensure the GT state initialization is visible before the flag is published.

>  	return 0;
>  }

[ ... ]

> @@ -1200,6 +1214,6 @@ void xe_gt_declare_wedged(struct xe_gt *gt)
>  {
>  	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
>  
> -	xe_uc_declare_wedged(&gt->uc);
> -	xe_tlb_inval_reset(&gt->tlb_inval);
> +	queue_work(gt->ordered_wq, &gt->wedge.worker);
> +	flush_work(&gt->wedge.worker);

[Severity: High]
Can this flush_work() call create a self-deadlock?

If a worker thread already executing on gt->ordered_wq (such as
gt_reset_worker() upon a reset failure) invokes xe_device_declare_wedged(),
it will eventually call xe_gt_declare_wedged().

Since gt->ordered_wq has a concurrency level of 1, queue_work() will place
wedge.worker behind the currently executing worker. The executing worker
will then block in flush_work(), waiting for wedge.worker to complete,
resulting in an unresolvable circular dependency that hangs the workqueue.

[Severity: High]
Does this also introduce a sleeping in atomic context regression?

xe_device_declare_wedged() can be called from mert_handle_cat_error(), which
is executed by the xe_mert_irq_handler() in hardirq context (for example,
directly from dg1_irq_handler()).

The flush_work() function relies on might_sleep(). Calling a sleeping
function from an atomic hardirq context will cause a 'scheduling while
atomic' kernel panic.

>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013110439.181447-1-raag.jadav@intel.com?part=1

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

* Re: [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method()
  2026-10-13 11:03 ` [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
@ 2026-10-13 11:20   ` sashiko-bot
  2026-10-13 18:30   ` Rodrigo Vivi
  1 sibling, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-10-13 11:20 UTC (permalink / raw)
  To: Raag Jadav, intel-xe

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/xe: sleeping in atomic context in xe_mert_irq_handler
- [Low] drm/xe: Stale kernel-doc for xe_device_declare_wedged()
--

commit 92170b825df41bc94e7e282489a7558acba677d1
Author: Raag Jadav <raag.jadav@intel.com>

drm/xe: Drop xe_device_set_wedged_method()

Commit 60439ac3f235 ("drm/xe: Add a helper function to set recovery
method") introduced xe_device_set_wedged_method() helper to allow setting
preferred recovery method before wedging the device, but also introduced
a flaw where the previously set method can be overwritten by concurrent
racing wedge call. This can result in unintended recovery method to be
sent to userspace and possibly failed recovery.

Drop xe_device_set_wedged_method() entirely and pass the recovery method
as part of xe_device_declare_wedged() argument, which places the preferred
recovery method on stack and avoids this issue.

Fixes: 60439ac3f235 ("drm/xe: Add a helper function to set recovery method")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>

> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 014bc5b0216dd..5b98b35cdbe8a 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -1371,24 +1371,13 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
>   *   firmware and restore device to normal operation.
>   */
>  
> -/**
> - * xe_device_set_wedged_method - Set wedged recovery method
> - * @xe: xe device instance
> - * @method: recovery method to set
> - *
> - * Set wedged recovery method to be sent in drm wedged uevent.
> - */
> -void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
> -{
> -	xe->wedged.method = method;
> -}
> -
>  #define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
>  #define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
>  
>  /**
>   * xe_device_declare_wedged - Declare device wedged
>   * @xe: xe device instance
> + * @method: method(s) to be used for recovery
>   *
>   * This is a final state that can only be cleared with the recovery method
>   * specified in the drm wedged uevent. The method can be set using

[Severity: Low]
Does this kernel-doc need to be updated to match the new behavior?

The documentation block for xe_device_declare_wedged() still instructs
developers to use the deleted xe_device_set_wedged_method() function and
describes a removed fallback behavior.

> @@ -1404,7 +1393,7 @@ void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
>   * snapshot capture. In this mode, GT reset won't be attempted so the state of
>   * the issue is preserved for further debugging.
>   */
> -void xe_device_declare_wedged(struct xe_device *xe)
> +void xe_device_declare_wedged(struct xe_device *xe, unsigned long method)
>  {
>  	struct xe_gt *gt;
>  	u8 id;

[ ... ]

> diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c
> index 32700c19a1df3..934be933d57f7 100644
> --- a/drivers/gpu/drm/xe/xe_mert.c
> +++ b/drivers/gpu/drm/xe/xe_mert.c
> @@ -74,7 +74,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	case CATERR_UNMAPPED_GGTT:
>  		xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
> -		xe_device_declare_wedged(xe);
> +		xe_device_declare_wedged(xe,
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);

[Severity: High]
Does this code sleep in an atomic context?

The mert_handle_cat_error() function is executed from the top-half hard IRQ
handler xe_mert_irq_handler() (via dg1_irq_handler()).

When a CATERR_UNMAPPED_GGTT or unexpected error code is detected, it calls
xe_device_declare_wedged(). This function performs synchronous wait
operations by calling xe_gt_declare_wedged(), which blocks on
flush_work(&gt->wedge.worker). It also allocates memory with GFP_KERNEL via
drm_dev_wedged_event() -> kobject_uevent_env().

Executing these blocking operations in a hardirq context triggers a
BUG: scheduling while atomic panic.

>  		break;
>  	case CATERR_LMTT_FAULT:
>  		xe_sriov_dbg_ratelimited(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
> @@ -82,7 +83,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	default:
>  		xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
> -		xe_device_declare_wedged(xe);
> +		xe_device_declare_wedged(xe,
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	}
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013110439.181447-1-raag.jadav@intel.com?part=2

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

* Re: [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras
  2026-10-13 11:03 ` [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
@ 2026-10-13 11:22   ` sashiko-bot
  0 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-10-13 11:22 UTC (permalink / raw)
  To: Raag Jadav, intel-xe

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] xe_ras: boot-time wedge uevents are dropped before device registration
--

commit 7cc17054a629b3feb51763fdbe477fcbb6bc6ef3
Author: Raag Jadav <raag.jadav@intel.com>

drm/xe/ras: Move xe_ras_process_errors() to xe_ras

This commit moves xe_ras_process_errors() from the end of the probe
sequence back to xe_ras_init(). This was done to revert a previous change
and process hardware errors detected before the driver was loaded.

> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 23dfff89a4aa0..8d23e9cac3c67 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 922e5e793b135..8e399ffec9856 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
[ ... ]
> @@ -932,6 +932,13 @@ void xe_ras_init(struct xe_device *xe)
>  	if (IS_ENABLED(CONFIG_PCIEAER))
>  		ras_usp_aer_init(xe);
>  
> +	/*
> +	 * During probe, process and log any errors detected by firmware while the driver was not
> +	 * loaded. Critical errors such as Punit and CSC are reported through Pcode init failure,
> +	 * causing the driver to enter survivability mode.
> +	 */
> +	xe_ras_process_errors(xe);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: Medium]
Will this silently drop boot-time wedge uevents?

Moving xe_ras_process_errors() to xe_ras_init() causes it to execute before
drm_dev_register() is called in the probe sequence.

If a hardware error is detected during early probe, xe_wedge_declare() in
drivers/gpu/drm/xe/xe_wedge.c will broadcast a wedge event to userspace:

drivers/gpu/drm/xe/xe_wedge.c:xe_wedge_declare()
  drivers/gpu/drm/drm_drv.c:drm_dev_wedged_event()
    kobject_uevent_env()

Since the DRM device has not been added to sysfs yet, the KOBJ_CHANGE uevent
is silently dropped by the kobject core because dev->primary->kdev is not
fully registered. This means userspace automation will miss the WEDGED uevent.

> +
>  	ret = devm_device_add_group(xe->drm.dev, &gpu_health_group);
>  	if (ret)
>  		xe_err(xe, "Failed to create GPU health sysfs, err=%d\n", ret);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261013110439.181447-1-raag.jadav@intel.com?part=5

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

* ✓ Xe.CI.BAT: success for Introduce xe_wedge (rev4)
  2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
                   ` (6 preceding siblings ...)
  2026-10-13 11:14 ` ✓ CI.KUnit: success " Patchwork
@ 2026-10-13 15:40 ` Patchwork
  7 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2026-10-13 15:40 UTC (permalink / raw)
  To: Raag Jadav; +Cc: intel-xe

[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]

== Series Details ==

Series: Introduce xe_wedge (rev4)
URL   : https://patchwork.freedesktop.org/series/173011/
State : success

== Summary ==

CI Bug Log - changes from xe-5937-f70a5a920a49326b4b953fe6f756586c21e3fbeb_BAT -> xe-pw-173011v4_BAT
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (15 -> 15)
------------------------------

  No changes in participating hosts

New tests
---------

  New tests have been introduced between xe-5937-f70a5a920a49326b4b953fe6f756586c21e3fbeb_BAT and xe-pw-173011v4_BAT:

### New IGT tests (3) ###

  * igt@xe_dma_buf_sync@export-dma-buf-once-read-write-sync:
    - Statuses : 14 pass(s)
    - Exec time: [0.01, 0.11] s

  * igt@xe_dma_buf_sync@export-dma-buf-once-write-read-sync:
    - Statuses : 14 pass(s)
    - Exec time: [0.01, 0.11] s

  * igt@xe_dma_buf_sync@export-dma-buf-once-write-sync:
    - Statuses : 14 pass(s)
    - Exec time: [0.02, 0.11] s

  

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

  Here are the changes found in xe-pw-173011v4_BAT that come from known issues:

### IGT changes ###

#### Possible fixes ####

  * igt@core_hotunplug@unbind-rebind:
    - bat-bmg-2:          [ABORT][1] ([Intel XE#9463]) -> [PASS][2]
   [1]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-5937-f70a5a920a49326b4b953fe6f756586c21e3fbeb/bat-bmg-2/igt@core_hotunplug@unbind-rebind.html
   [2]: https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-173011v4/bat-bmg-2/igt@core_hotunplug@unbind-rebind.html

  
  [Intel XE#9463]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/9463


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

  * Linux: xe-5937-f70a5a920a49326b4b953fe6f756586c21e3fbeb -> xe-pw-173011v4

  IGT_9141: 272395cfec06bd5809c9b9c0a17a32f34c48799c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  xe-5937-f70a5a920a49326b4b953fe6f756586c21e3fbeb: f70a5a920a49326b4b953fe6f756586c21e3fbeb
  xe-pw-173011v4: 173011v4

== Logs ==

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

[-- Attachment #2: Type: text/html, Size: 2699 bytes --]

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

* Re: [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging
  2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
  2026-10-13 11:19   ` sashiko-bot
@ 2026-10-13 18:29   ` Rodrigo Vivi
  2026-10-13 18:49     ` Matthew Brost
  1 sibling, 1 reply; 17+ messages in thread
From: Rodrigo Vivi @ 2026-10-13 18:29 UTC (permalink / raw)
  To: Raag Jadav
  Cc: intel-xe, riana.tauro, michal.wajdeczko, lukasz.laguna,
	matthew.d.roper, matthew.brost, mallesh.koujalagi

On Tue, Oct 13, 2026 at 04:33:53PM +0530, Raag Jadav wrote:
> Currently, xe_gt_declare_wedged() stops GuC CT and initiates exec queue
> teardown synchronously. This can result in tdr timeout in cases where
> the device is declared wedged while jobs are still in-flight.
> 
> Introduce a worker for GT specific wedge handling and queue the teardown
> on GT ordered workqueue, so we don't disrupt the scheduler while jobs
> are still in-flight.
> 
> While at it, introduce for_each_initialized_gt() macro and use it for
> wedging GT. This helps avoid races in case the device is declared wedged
> in probe sequence before GT is initialized.
> 
> Fixes: c9474b726b93 ("drm/xe: Wedge the entire device")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> v2: Split fixes into separate patches (Rodrigo, Michal)
> v4: Introduce for_each_initialized_gt() (Michal)
> v5: Flush GT wedge worker to avoid races (Sashiko)
> ---
>  drivers/gpu/drm/xe/xe_device.c   |  2 +-
>  drivers/gpu/drm/xe/xe_device.h   |  4 ++++
>  drivers/gpu/drm/xe/xe_gt.c       | 18 ++++++++++++++++--
>  drivers/gpu/drm/xe/xe_gt_types.h |  9 +++++++++
>  4 files changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 8392c9fad3c4..22ae10958d7f 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -1432,7 +1432,7 @@ void xe_device_declare_wedged(struct xe_device *xe)
>  			    WEDGED_URL, XE_BUG_URL);
>  	}
>  
> -	for_each_gt(gt, xe, id)
> +	for_each_initialized_gt(gt, xe, id)
>  		xe_gt_declare_wedged(gt);
>  
>  	if (xe_device_wedged(xe)) {
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index 83d6dafab53c..80bda9b548d5 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -139,6 +139,10 @@ static inline bool xe_device_uc_enabled(struct xe_device *xe)
>  	for_each_gt((gt__), (tile__)->xe, (id__)) \
>  		for_each_if((gt__)->tile == (tile__))
>  
> +#define for_each_initialized_gt(gt__, xe__, id__) \
> +	for_each_gt((gt__), (xe__), (id__)) \
> +		for_each_if(READ_ONCE((gt__)->initialized))
> +
>  static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
>  {
>  	return &gt->pm.fw;
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 775c826b68b4..4e047cfaf603 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -175,6 +175,7 @@ static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt)
>  }
>  
>  static void gt_reset_worker(struct work_struct *w);
> +static void gt_wedge_worker(struct work_struct *w);
>  
>  static int emit_job_sync(struct xe_exec_queue *q, struct xe_bb *bb,
>  			 long timeout_jiffies, bool force_reset)
> @@ -706,6 +707,8 @@ static void xe_gt_fini(void *arg)
>  	struct xe_gt *gt = arg;
>  	int i;
>  
> +	disable_work_sync(&gt->wedge.worker);
> +
>  	if (disable_work_sync(&gt->reset.worker))
>  		/*
>  		 * If gt_reset_worker was halted from executing, take care of
> @@ -725,6 +728,7 @@ int xe_gt_init(struct xe_gt *gt)
>  	int i;
>  
>  	INIT_WORK(&gt->reset.worker, gt_reset_worker);
> +	INIT_WORK(&gt->wedge.worker, gt_wedge_worker);

perhaps this should be in the gt_alloc or some init early?

>  
>  	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i) {
>  		gt->ring_ops[i] = xe_ring_ops_get(gt, i);
> @@ -769,6 +773,8 @@ int xe_gt_init(struct xe_gt *gt)
>  			return err;
>  	}
>  
> +	/* Must be last */
> +	WRITE_ONCE(gt->initialized, true);
>  	return 0;
>  }
>  
> @@ -1010,6 +1016,14 @@ void xe_gt_reset_async(struct xe_gt *gt)
>  		xe_pm_runtime_put(xe);
>  }
>  
> +static void gt_wedge_worker(struct work_struct *w)
> +{
> +	struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
> +
> +	xe_uc_declare_wedged(&gt->uc);
> +	xe_tlb_inval_reset(&gt->tlb_inval);
> +}
> +
>  void xe_gt_suspend_prepare(struct xe_gt *gt)
>  {
>  	xe_uc_suspend_prepare(&gt->uc);
> @@ -1200,6 +1214,6 @@ void xe_gt_declare_wedged(struct xe_gt *gt)
>  {
>  	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
>  
> -	xe_uc_declare_wedged(&gt->uc);
> -	xe_tlb_inval_reset(&gt->tlb_inval);
> +	queue_work(gt->ordered_wq, &gt->wedge.worker);
> +	flush_work(&gt->wedge.worker);

This flush serialize things, but apparently it deadlock somewhere else now.
Perhaps we should avoid this one here and instead flush for each gt in
pci disable case.

>  }
> diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
> index 628911346455..c00a7c171f80 100644
> --- a/drivers/gpu/drm/xe/xe_gt_types.h
> +++ b/drivers/gpu/drm/xe/xe_gt_types.h
> @@ -233,6 +233,12 @@ struct xe_gt {
>  		struct work_struct worker;
>  	} reset;
>  
> +	/** @wedge: state for GT wedge */
> +	struct {
> +		/** @wedge.worker: worker for GT wedge to be done async */
> +		struct work_struct worker;
> +	} wedge;
> +
>  	/** @tlb_inval: TLB invalidation state */
>  	struct xe_tlb_inval tlb_inval;
>  
> @@ -419,6 +425,9 @@ struct xe_gt {
>  
>  	/** @eu_stall: EU stall counters subsystem per gt info */
>  	struct xe_eu_stall_gt *eu_stall;
> +
> +	/** @initialized: GT is initialized */
> +	bool initialized;
>  };
>  
>  #endif
> -- 
> 2.43.0
> 

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

* Re: [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method()
  2026-10-13 11:03 ` [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
  2026-10-13 11:20   ` sashiko-bot
@ 2026-10-13 18:30   ` Rodrigo Vivi
  1 sibling, 0 replies; 17+ messages in thread
From: Rodrigo Vivi @ 2026-10-13 18:30 UTC (permalink / raw)
  To: Raag Jadav
  Cc: intel-xe, riana.tauro, michal.wajdeczko, lukasz.laguna,
	matthew.d.roper, matthew.brost, mallesh.koujalagi

On Tue, Oct 13, 2026 at 04:33:54PM +0530, Raag Jadav wrote:
> Commit 60439ac3f235 ("drm/xe: Add a helper function to set recovery
> method") introduced xe_device_set_wedged_method() helper to allow setting
> preferred recovery method before wedging the device, but also introduced
> a flaw where the previously set method can be overwritten by concurrent
> racing wedge call. This can result in unintended recovery method to be
> sent to userspace and possibly failed recovery.
> 
> Drop xe_device_set_wedged_method() entirely and pass the recovery method
> as part of xe_device_declare_wedged() argument, which places the preferred
> recovery method on stack and avoids this issue.
> 
> Fixes: 60439ac3f235 ("drm/xe: Add a helper function to set recovery method")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_amc.c                |  3 ++-
>  drivers/gpu/drm/xe/xe_device.c             | 23 ++++------------------
>  drivers/gpu/drm/xe/xe_device.h             |  3 +--
>  drivers/gpu/drm/xe/xe_device_types.h       |  2 --
>  drivers/gpu/drm/xe/xe_gsc.c                |  3 ++-
>  drivers/gpu/drm/xe/xe_gt.c                 |  3 ++-
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c        |  2 +-
>  drivers/gpu/drm/xe/xe_guc_submit.c         |  5 +++--
>  drivers/gpu/drm/xe/xe_mert.c               |  6 ++++--
>  drivers/gpu/drm/xe/xe_pci_error.c          |  3 ++-
>  drivers/gpu/drm/xe/xe_ras.c                |  3 +--
>  drivers/gpu/drm/xe/xe_survivability_mode.c |  3 +--
>  12 files changed, 23 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_amc.c b/drivers/gpu/drm/xe/xe_amc.c
> index 8ecadee6eea3..b7390a4ee3ce 100644
> --- a/drivers/gpu/drm/xe/xe_amc.c
> +++ b/drivers/gpu/drm/xe/xe_amc.c
> @@ -160,7 +160,8 @@ static void xe_amc_work(struct work_struct *work)
>  	case AMC_ALERT_OOB_RESET:
>  	case AMC_ALERT_CATERR:
>  		dev_warn(amc->i2c->drm_dev, "AMC Alert: %s\n", amc_alert[alert_reason]);
> -		xe_device_declare_wedged(i2c_client_to_xe_device(client));
> +		xe_device_declare_wedged(i2c_client_to_xe_device(client),
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	default:
>  		dev_warn(amc->i2c->drm_dev, "unknown AMC alert: %d\n", alert_reason);
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 22ae10958d7f..0d9ef4f1ab9a 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -1378,24 +1378,13 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
>   *   firmware and restore device to normal operation.
>   */
>  
> -/**
> - * xe_device_set_wedged_method - Set wedged recovery method
> - * @xe: xe device instance
> - * @method: recovery method to set
> - *
> - * Set wedged recovery method to be sent in drm wedged uevent.
> - */
> -void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
> -{
> -	xe->wedged.method = method;
> -}
> -
>  #define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
>  #define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
>  
>  /**
>   * xe_device_declare_wedged - Declare device wedged
>   * @xe: xe device instance
> + * @method: method(s) to be used for recovery
>   *
>   * This is a final state that can only be cleared with the recovery method
>   * specified in the drm wedged uevent. The method can be set using
> @@ -1411,7 +1400,7 @@ void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method)
>   * snapshot capture. In this mode, GT reset won't be attempted so the state of
>   * the issue is preserved for further debugging.
>   */
> -void xe_device_declare_wedged(struct xe_device *xe)
> +void xe_device_declare_wedged(struct xe_device *xe, unsigned long method)
>  {
>  	struct xe_gt *gt;
>  	u8 id;
> @@ -1442,14 +1431,10 @@ void xe_device_declare_wedged(struct xe_device *xe)
>  		 * it available to the user for debugging.
>  		 */
>  		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);
> +			method = DRM_WEDGE_RECOVERY_NONE;
>  
>  		/* Notify userspace of wedged device */
> -		drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL);
> +		drm_dev_wedged_event(&xe->drm, method, NULL);
>  	}
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index 80bda9b548d5..9f35370c0851 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -264,8 +264,7 @@ static inline bool xe_debug_page_size_mode_is_mixed(struct xe_device *xe)
>  }
>  #endif
>  
> -void xe_device_set_wedged_method(struct xe_device *xe, unsigned long method);
> -void xe_device_declare_wedged(struct xe_device *xe);
> +void xe_device_declare_wedged(struct xe_device *xe, unsigned long method);
>  int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode);
>  const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode);
>  
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index 4e0e1bc040c1..00ce8e9872ea 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -543,8 +543,6 @@ struct xe_device {
>  		atomic_t flag;
>  		/** @wedged.mode: Mode controlled by kernel parameter and debugfs */
>  		enum xe_wedged_mode mode;
> -		/** @wedged.method: Recovery method to be sent in the drm device wedged uevent */
> -		unsigned long method;
>  		/** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
>  		bool inconsistent_reset;
>  	} wedged;
> diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
> index 524ac56bdcc7..2bbe0f20ff8d 100644
> --- a/drivers/gpu/drm/xe/xe_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_gsc.c
> @@ -340,7 +340,8 @@ static int gsc_er_complete(struct xe_gt *gt)
>  		 * declare the device as wedged.
>  		 */
>  		xe_gt_err(gt, "GSC ER timed out!\n");
> -		xe_device_declare_wedged(gt_to_xe(gt));
> +		xe_device_declare_wedged(gt_to_xe(gt),
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		return -EIO;
>  	}
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 4e047cfaf603..f35ae3a532ee 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -992,7 +992,8 @@ static void gt_reset_worker(struct work_struct *w)
>  
>  err_fail:
>  	xe_log_err_fatal(gt, GT, err, "reset failed\n");
> -	xe_device_declare_wedged(gt_to_xe(gt));
> +	xe_device_declare_wedged(gt_to_xe(gt),
> +				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  err_pm_put:
>  	xe_pm_runtime_put(gt_to_xe(gt));
>  }
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 37899fcf5b22..28ec83bb8100 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -1462,7 +1462,7 @@ static void vf_post_migration_recovery(struct xe_gt *gt)
>  fail:
>  	vf_post_migration_abort(gt);
>  	xe_gt_sriov_err(gt, "migration recovery failed (%pe)\n", ERR_PTR(err));
> -	xe_device_declare_wedged(xe);
> +	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  	return;
>  
>  queue:
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 7ce73489c35f..e2a0b989cfc8 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1453,7 +1453,7 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc)
>  	if (xe_device_wedged(xe))
>  		return true;
>  
> -	xe_device_declare_wedged(xe);
> +	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  
>  	return true;
>  }
> @@ -1780,7 +1780,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
>  	}
>  
>  	if (wedge_device)
> -		xe_device_declare_wedged(gt_to_xe(q->gt));
> +		xe_device_declare_wedged(gt_to_xe(q->gt),
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  
>  	/*
>  	 * We want the job added back to the pending list so it gets freed; this
> diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c
> index 32700c19a1df..934be933d57f 100644
> --- a/drivers/gpu/drm/xe/xe_mert.c
> +++ b/drivers/gpu/drm/xe/xe_mert.c
> @@ -74,7 +74,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	case CATERR_UNMAPPED_GGTT:
>  		xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
> -		xe_device_declare_wedged(xe);
> +		xe_device_declare_wedged(xe,
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	case CATERR_LMTT_FAULT:
>  		xe_sriov_dbg_ratelimited(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
> @@ -82,7 +83,8 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	default:
>  		xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
> -		xe_device_declare_wedged(xe);
> +		xe_device_declare_wedged(xe,
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	}
>  }
> diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
> index 79ce0c671549..fdecd3e0b9a9 100644
> --- a/drivers/gpu/drm/xe/xe_pci_error.c
> +++ b/drivers/gpu/drm/xe/xe_pci_error.c
> @@ -86,7 +86,8 @@ static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev)
>  
>  	/* User wants to debug the error, prevent reset */
>  	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> -		xe_device_declare_wedged(xe);
> +		xe_device_declare_wedged(xe,
> +					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		return PCI_ERS_RESULT_DISCONNECT;
>  	}
>  
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 7a85735c57d5..fe16a4106060 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -321,8 +321,7 @@ static u8 handle_core_compute_errors(struct xe_ras_error_array *arr)
>  
>  static void punit_error_handler(struct xe_device *xe)
>  {
> -	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
> -	xe_device_declare_wedged(xe);
> +	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
>  }
>  
>  static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_array *arr)
> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
> index 45d44ebe288b..ca031576fecb 100644
> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
> @@ -446,8 +446,7 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
>  	survivability->type = XE_SURVIVABILITY_TYPE_RUNTIME;
>  	xe_log_err(xe, SURVIVABILITY, 0, "Runtime Mode enabled!\n");
>  
> -	xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_VENDOR);
> -	xe_device_declare_wedged(xe);
> +	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_VENDOR);
>  
>  	xe_log_err(xe, SURVIVABILITY, 0, "Firmware flash required!\n");
>  	xe_info(xe, "Please refer to the userspace documentation for more details how to flash the firmware on %s!\n",
> -- 
> 2.43.0
> 

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

* Re: [PATCH v5 4/5] drm/xe: Introduce xe_wedge
  2026-10-13 11:03 ` [PATCH v5 4/5] drm/xe: Introduce xe_wedge Raag Jadav
  2026-10-13 11:16   ` sashiko-bot
@ 2026-10-13 18:32   ` Rodrigo Vivi
  1 sibling, 0 replies; 17+ messages in thread
From: Rodrigo Vivi @ 2026-10-13 18:32 UTC (permalink / raw)
  To: Raag Jadav
  Cc: intel-xe, riana.tauro, michal.wajdeczko, lukasz.laguna,
	matthew.d.roper, matthew.brost, mallesh.koujalagi

On Tue, Oct 13, 2026 at 04:33:56PM +0530, Raag Jadav wrote:
> Consolidate wedging implementation into a dedicated xe_wedge component
> for better maintainability. While at it, rename all wedge helpers
> to match with component name.
> 
> No functional impact.
> 
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> Acked-by: Matthew Brost <matthew.brost@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
> v2: Also move struct xe_wedge and wedged_mode debt to xe_wedge (Lukasz, Michal)
>     Naming and aesthetic adjustments (Lukasz, Michal)
> v3: Respect the component namespace (Rodrigo)
>     Avoid chaining header includes (Rodrigo)
>     Squash debugfs changes with xe_wedge patch (Lukasz)
> v4: Include xe_sriov.h (Rodrigo)
> ---
>  Documentation/gpu/xe/xe_device.rst          |   2 +-
>  drivers/gpu/drm/xe/Makefile                 |   1 +
>  drivers/gpu/drm/xe/tests/xe_kunit_helpers.c |   3 +-
>  drivers/gpu/drm/xe/xe_amc.c                 |   5 +-
>  drivers/gpu/drm/xe/xe_bo.c                  |   3 +-
>  drivers/gpu/drm/xe/xe_debugfs.c             |  66 +----
>  drivers/gpu/drm/xe/xe_device.c              | 166 +------------
>  drivers/gpu/drm/xe/xe_device.h              |   9 -
>  drivers/gpu/drm/xe/xe_device_types.h        |  26 +-
>  drivers/gpu/drm/xe/xe_gsc.c                 |   5 +-
>  drivers/gpu/drm/xe/xe_gt.c                  |  12 +-
>  drivers/gpu/drm/xe/xe_gt.h                  |   2 +-
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c         |   3 +-
>  drivers/gpu/drm/xe/xe_guc.c                 |   4 +-
>  drivers/gpu/drm/xe/xe_guc.h                 |   2 +-
>  drivers/gpu/drm/xe/xe_guc_ct.c              |   7 +-
>  drivers/gpu/drm/xe/xe_guc_pc.c              |  11 +-
>  drivers/gpu/drm/xe/xe_guc_rc.c              |   5 +-
>  drivers/gpu/drm/xe/xe_guc_submit.c          |  15 +-
>  drivers/gpu/drm/xe/xe_guc_tlb_inval.c       |   3 +-
>  drivers/gpu/drm/xe/xe_mert.c                |   7 +-
>  drivers/gpu/drm/xe/xe_pci_error.c           |  10 +-
>  drivers/gpu/drm/xe/xe_ras.c                 |   3 +-
>  drivers/gpu/drm/xe/xe_sriov_pf.c            |   3 +-
>  drivers/gpu/drm/xe/xe_survivability_mode.c  |   3 +-
>  drivers/gpu/drm/xe/xe_uc.c                  |   6 +-
>  drivers/gpu/drm/xe/xe_uc.h                  |   2 +-
>  drivers/gpu/drm/xe/xe_wedge.c               | 261 ++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_wedge.h               |  19 ++
>  drivers/gpu/drm/xe/xe_wedge_types.h         |  39 +++
>  30 files changed, 394 insertions(+), 309 deletions(-)
>  create mode 100644 drivers/gpu/drm/xe/xe_wedge.c
>  create mode 100644 drivers/gpu/drm/xe/xe_wedge.h
>  create mode 100644 drivers/gpu/drm/xe/xe_wedge_types.h
> 
> diff --git a/Documentation/gpu/xe/xe_device.rst b/Documentation/gpu/xe/xe_device.rst
> index d3a022362ade..8baed81580c9 100644
> --- a/Documentation/gpu/xe/xe_device.rst
> +++ b/Documentation/gpu/xe/xe_device.rst
> @@ -6,7 +6,7 @@
>  Xe Device Wedging
>  ==================
>  
> -.. kernel-doc:: drivers/gpu/drm/xe/xe_device.c
> +.. kernel-doc:: drivers/gpu/drm/xe/xe_wedge.c
>     :doc: Xe Device Wedging
>  
>  ====================
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index 011f7ef54086..bc203940f114 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -154,6 +154,7 @@ xe-y += xe_bb.o \
>  	xe_vsec.o \
>  	xe_wa.o \
>  	xe_wait_user_fence.o \
> +	xe_wedge.o \
>  	xe_wopcm.o
>  
>  xe-$(CONFIG_I2C)	+= xe_i2c.o \
> diff --git a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
> index 27740b40c8ae..57ea88cce92d 100644
> --- a/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
> +++ b/drivers/gpu/drm/xe/tests/xe_kunit_helpers.c
> @@ -15,6 +15,7 @@
>  #include "xe_device.h"
>  #include "xe_device_types.h"
>  #include "xe_pm.h"
> +#include "xe_wedge.h"
>  
>  /**
>   * xe_kunit_helper_alloc_xe_device - Allocate a &xe_device for a KUnit test.
> @@ -123,7 +124,7 @@ int xe_kunit_helper_xe_device_live_test_init(struct kunit *test)
>  	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, xe);
>  	kunit_info(test, "running on %s device\n", xe->info.platform_name);
>  
> -	KUNIT_ASSERT_FALSE(test, xe_device_wedged(xe));
> +	KUNIT_ASSERT_FALSE(test, xe_wedged(xe));
>  	xe_pm_runtime_get(xe);
>  	KUNIT_ASSERT_EQ(test, 0, kunit_add_action_or_reset(test, put_xe_pm_runtime, xe));
>  
> diff --git a/drivers/gpu/drm/xe/xe_amc.c b/drivers/gpu/drm/xe/xe_amc.c
> index b7390a4ee3ce..3b91c0d489f5 100644
> --- a/drivers/gpu/drm/xe/xe_amc.c
> +++ b/drivers/gpu/drm/xe/xe_amc.c
> @@ -18,6 +18,7 @@
>  #include "xe_device.h"
>  #include "xe_i2c.h"
>  #include "xe_mmio.h"
> +#include "xe_wedge.h"
>  
>  /**
>   * DOC: Add-In Management Controller (AMC)
> @@ -160,8 +161,8 @@ static void xe_amc_work(struct work_struct *work)
>  	case AMC_ALERT_OOB_RESET:
>  	case AMC_ALERT_CATERR:
>  		dev_warn(amc->i2c->drm_dev, "AMC Alert: %s\n", amc_alert[alert_reason]);
> -		xe_device_declare_wedged(i2c_client_to_xe_device(client),
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(i2c_client_to_xe_device(client),
> +				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	default:
>  		dev_warn(amc->i2c->drm_dev, "unknown AMC alert: %d\n", alert_reason);
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 12e523c61c1f..10a3f156a9d3 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -41,6 +41,7 @@
>  #include "xe_ttm_stolen_mgr.h"
>  #include "xe_vm.h"
>  #include "xe_vram_types.h"
> +#include "xe_wedge.h"
>  
>  const char *const xe_mem_type_to_name[TTM_NUM_MEM_TYPES]  = {
>  	[XE_PL_SYSTEM] = "system",
> @@ -2203,7 +2204,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_wedged(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);
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index 926020c7526e..e59d4964d811 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -18,13 +18,12 @@
>  #include "xe_force_wake.h"
>  #include "xe_gt.h"
>  #include "xe_gt_debugfs.h"
> -#include "xe_gt_printk.h"
> -#include "xe_guc_ads.h"
>  #include "xe_hw_engine.h"
>  #include "xe_mmio.h"
>  #include "xe_pagefault.h"
>  #include "xe_pcode.h"
>  #include "xe_pm.h"
> +#include "xe_printk.h"
>  #include "xe_psmi.h"
>  #include "xe_pxp_debugfs.h"
>  #include "xe_sriov.h"
> @@ -36,6 +35,7 @@
>  #include "xe_ttm_vram_mgr.h"
>  #include "xe_vsec.h"
>  #include "xe_wa.h"
> +#include "xe_wedge.h"
>  
>  #ifdef CONFIG_DRM_XE_DEBUG
>  #include "xe_bo_evict.h"
> @@ -424,58 +424,6 @@ static ssize_t wedged_mode_show(struct file *f, char __user *ubuf,
>  	return simple_read_from_buffer(ubuf, size, pos, buf, len);
>  }
>  
> -static int __wedged_mode_set_reset_policy(struct xe_gt *gt, enum xe_wedged_mode mode)
> -{
> -	bool enable_engine_reset;
> -	int ret;
> -
> -	enable_engine_reset = (mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET);
> -	ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads,
> -						       enable_engine_reset);
> -	if (ret)
> -		xe_gt_err(gt, "Failed to update GuC ADS scheduler policy (%pe)\n", ERR_PTR(ret));
> -
> -	return ret;
> -}
> -
> -static int wedged_mode_set_reset_policy(struct xe_device *xe, enum xe_wedged_mode mode)
> -{
> -	struct xe_gt *gt;
> -	int ret;
> -	u8 id;
> -
> -	guard(xe_pm_runtime)(xe);
> -	for_each_gt(gt, xe, id) {
> -		ret = __wedged_mode_set_reset_policy(gt, mode);
> -		if (ret) {
> -			if (id > 0) {
> -				xe->wedged.inconsistent_reset = true;
> -				drm_err(&xe->drm, "Inconsistent reset policy state between GTs\n");
> -			}
> -			return ret;
> -		}
> -	}
> -
> -	xe->wedged.inconsistent_reset = false;
> -
> -	return 0;
> -}
> -
> -static bool wedged_mode_needs_policy_update(struct xe_device *xe, enum xe_wedged_mode mode)
> -{
> -	if (xe->wedged.inconsistent_reset)
> -		return true;
> -
> -	if (xe->wedged.mode == mode)
> -		return false;
> -
> -	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET ||
> -	    mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
> -		return true;
> -
> -	return false;
> -}
> -
>  static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
>  			       size_t size, loff_t *pos)
>  {
> @@ -487,18 +435,10 @@ static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
>  	if (ret)
>  		return ret;
>  
> -	ret = xe_device_validate_wedged_mode(xe, wedged_mode);
> +	ret = xe_wedge_set_mode(xe, wedged_mode);
>  	if (ret)
>  		return ret;
>  
> -	if (wedged_mode_needs_policy_update(xe, wedged_mode)) {
> -		ret = wedged_mode_set_reset_policy(xe, wedged_mode);
> -		if (ret)
> -			return ret;
> -	}
> -
> -	xe->wedged.mode = wedged_mode;
> -
>  	return size;
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index f4bcc27f4b71..e0466390219c 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -81,6 +81,7 @@
>  #include "xe_vsec.h"
>  #include "xe_wait_user_fence.h"
>  #include "xe_wa.h"
> +#include "xe_wedge.h"
>  
>  #include <generated/xe_device_wa_oob.h>
>  #include <generated/xe_wa_oob.h>
> @@ -238,7 +239,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_wedged(xe))
>  		return -ECANCELED;
>  
>  	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
> @@ -256,7 +257,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_wedged(xe))
>  		return -ECANCELED;
>  
>  	ACQUIRE(xe_pm_runtime_ioctl, pm)(xe);
> @@ -697,8 +698,6 @@ static int xe_device_vram_alloc(struct xe_device *xe)
>  	return 0;
>  }
>  
> -static void xe_device_wedged_fini(struct drm_device *drm, void *arg);
> -
>  /**
>   * xe_device_probe_early: Device early probe
>   * @xe: xe device instance
> @@ -758,16 +757,11 @@ int xe_device_probe_early(struct xe_device *xe)
>  	 */
>  	assert_lmem_ready(xe);
>  
> -	xe->wedged.mode = xe_device_validate_wedged_mode(xe, xe_modparam.wedged_mode) ?
> -			  XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
> -	drm_dbg(&xe->drm, "wedged_mode: setting mode (%u) %s\n",
> -		xe->wedged.mode, xe_wedged_mode_to_string(xe->wedged.mode));
> -
>  	err = xe_device_vram_alloc(xe);
>  	if (err)
>  		return err;
>  
> -	err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
> +	err = xe_wedge_init(xe);
>  	if (err)
>  		return err;
>  
> @@ -857,14 +851,6 @@ static void detect_preproduction_hw(struct xe_device *xe)
>  	}
>  }
>  
> -static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
> -{
> -	struct xe_device *xe = arg;
> -
> -	if (atomic_read(&xe->wedged.flag))
> -		xe_pm_runtime_put(xe);
> -}
> -
>  #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
>  static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
>  {
> @@ -1104,7 +1090,7 @@ int xe_device_probe(struct xe_device *xe)
>  	/*
>  	 * Process and log any errors detected by hardware. Possible results can
>  	 * include declaring the device as wedged, which must be done only after
> -	 * xe_device_wedged_fini() is registered.
> +	 * xe_wedge_fini() is registered.
>  	 */
>  	xe_ras_process_errors(xe);
>  
> @@ -1343,148 +1329,6 @@ u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
>  	return address & GENMASK_ULL(xe->info.va_bits - 1, 0);
>  }
>  
> -/**
> - * DOC: Xe Device Wedging
> - *
> - * Xe driver uses drm device wedged uevent as documented in Documentation/gpu/drm-uapi.rst.
> - * When device is in wedged state, every IOCTL will be blocked and GT cannot
> - * be used. The conditions under which the driver declares the device wedged
> - * depend on the wedged mode configuration (see &enum xe_wedged_mode). The
> - * default recovery method for a wedged state is rebind/bus-reset.
> - *
> - * Another recovery method is vendor-specific. Below are the cases that send
> - * ``WEDGED=vendor-specific`` recovery method in drm device wedged uevent.
> - *
> - * Case: Firmware Flash
> - * --------------------
> - *
> - * Identification Hint
> - * +++++++++++++++++++
> - *
> - * ``WEDGED=vendor-specific`` drm device wedged uevent with
> - * :ref:`Runtime Survivability mode <xe-survivability-mode>` is used to notify
> - * admin/userspace consumer about the need for a firmware flash.
> - *
> - * Recovery Procedure
> - * ++++++++++++++++++
> - *
> - * Once ``WEDGED=vendor-specific`` drm device wedged uevent is received, follow
> - * the below steps
> - *
> - * - Check Runtime Survivability mode sysfs.
> - *   If enabled, firmware flash is required to recover the device.
> - *
> - *   /sys/bus/pci/devices/<device>/survivability_mode
> - *
> - * - Admin/userspace consumer can use firmware flashing tools like fwupd to flash
> - *   firmware and restore device to normal operation.
> - */
> -
> -#define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
> -#define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
> -
> -/**
> - * xe_device_declare_wedged - Declare device wedged
> - * @xe: xe device instance
> - * @method: method(s) to be used for recovery
> - *
> - * This is a final state that can only be cleared with the recovery method
> - * specified in the drm wedged uevent. The method can be set using
> - * xe_device_set_wedged_method before declaring the device as wedged. If no method
> - * is set, reprobe (unbind/re-bind) will be sent by default.
> - *
> - * In this state every IOCTL will be blocked so the GT cannot be used.
> - * In general it will be called upon any critical error such as gt reset
> - * failure or guc loading failure. Userspace will be notified of this state
> - * through device wedged uevent.
> - * If xe.wedged module parameter is set to 2, this function will be called
> - * on every single execution timeout (a.k.a. GPU hang) right after devcoredump
> - * snapshot capture. In this mode, GT reset won't be attempted so the state of
> - * the issue is preserved for further debugging.
> - */
> -void xe_device_declare_wedged(struct xe_device *xe, unsigned long method)
> -{
> -	struct xe_gt *gt;
> -	u8 id;
> -
> -	if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
> -		drm_dbg(&xe->drm, "Wedged mode is forcibly disabled\n");
> -		return;
> -	}
> -
> -	if (!atomic_xchg(&xe->wedged.flag, 1)) {
> -		xe->needs_flr_on_fini = true;
> -		xe_pm_runtime_get_noresume(xe);
> -
> -		xe_log_err_fatal(xe, WEDGED, -EIO, "Device declared wedged!\n");
> -		xe_err_once(xe, "IOCTLs and executions are now blocked!\n"
> -			    "For recovery procedure, refer to %s\n"
> -			    "Please file a _new_ bug report at %s\n",
> -			    WEDGED_URL, XE_BUG_URL);
> -	}
> -
> -	for_each_initialized_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
> -		 * it available to the user for debugging.
> -		 */
> -		if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
> -			method = DRM_WEDGE_RECOVERY_NONE;
> -
> -		/* Notify userspace of wedged device */
> -		drm_dev_wedged_event(&xe->drm, method, NULL);
> -	}
> -}
> -
> -/**
> - * xe_device_validate_wedged_mode - Check if given mode is supported
> - * @xe: the &xe_device
> - * @mode: requested mode to validate
> - *
> - * Check whether the provided wedged mode is supported.
> - *
> - * Return: 0 if mode is supported, error code otherwise.
> - */
> -int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode)
> -{
> -	if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> -		drm_dbg(&xe->drm, "wedged_mode: invalid value (%u)\n", mode);
> -		return -EINVAL;
> -	} else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
> -		   (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
> -		drm_dbg(&xe->drm, "wedged_mode: (%u) %s mode is not supported for %s\n",
> -			mode, xe_wedged_mode_to_string(mode),
> -			xe_sriov_mode_to_string(xe_device_sriov_mode(xe)));
> -		return -EPERM;
> -	}
> -
> -	return 0;
> -}
> -
> -/**
> - * xe_wedged_mode_to_string - Convert enum value to string.
> - * @mode: the &xe_wedged_mode to convert
> - *
> - * Returns: wedged mode as a user friendly string.
> - */
> -const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode)
> -{
> -	switch (mode) {
> -	case XE_WEDGED_MODE_NEVER:
> -		return "never";
> -	case XE_WEDGED_MODE_UPON_CRITICAL_ERROR:
> -		return "upon-critical-error";
> -	case XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET:
> -		return "upon-any-hang-no-reset";
> -	default:
> -		return "<invalid>";
> -	}
> -}
> -
>  /**
>   * xe_device_asid_to_vm() - Find VM from ASID
>   * @xe: the &xe_device
> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> index 9f35370c0851..6df60edcb8f8 100644
> --- a/drivers/gpu/drm/xe/xe_device.h
> +++ b/drivers/gpu/drm/xe/xe_device.h
> @@ -211,11 +211,6 @@ bool xe_device_is_l2_flush_optimized(struct xe_device *xe);
>  void xe_device_td_flush(struct xe_device *xe);
>  void xe_device_l2_flush(struct xe_device *xe, bool force);
>  
> -static inline bool xe_device_wedged(struct xe_device *xe)
> -{
> -	return atomic_read(&xe->wedged.flag);
> -}
> -
>  #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
>  static inline bool xe_debug_page_size_supported(struct xe_device *xe)
>  {
> @@ -264,10 +259,6 @@ static inline bool xe_debug_page_size_mode_is_mixed(struct xe_device *xe)
>  }
>  #endif
>  
> -void xe_device_declare_wedged(struct xe_device *xe, unsigned long method);
> -int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode);
> -const char *xe_wedged_mode_to_string(enum xe_wedged_mode mode);
> -
>  struct xe_file *xe_file_get(struct xe_file *xef);
>  void xe_file_put(struct xe_file *xef);
>  
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index 00ce8e9872ea..25b38258b629 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -30,6 +30,7 @@
>  #include "xe_sysctrl_types.h"
>  #include "xe_tile_types.h"
>  #include "xe_validation.h"
> +#include "xe_wedge_types.h"
>  
>  #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
>  #define TEST_VM_OPS_ERROR
> @@ -47,22 +48,6 @@ struct xe_pxp;
>  struct xe_ttm_stolen_mgr;
>  struct xe_vram_region;
>  
> -/**
> - * enum xe_wedged_mode - possible wedged modes
> - * @XE_WEDGED_MODE_NEVER: Device will never be declared wedged.
> - * @XE_WEDGED_MODE_UPON_CRITICAL_ERROR: Device will be declared wedged only
> - *	when critical error occurs like GT reset failure or firmware failure.
> - *	This is the default mode.
> - * @XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET: Device will be declared wedged on
> - *	any hang. In this mode, engine resets are disabled to avoid automatic
> - *	recovery attempts. This mode is primarily intended for debugging hangs.
> - */
> -enum xe_wedged_mode {
> -	XE_WEDGED_MODE_NEVER = 0,
> -	XE_WEDGED_MODE_UPON_CRITICAL_ERROR = 1,
> -	XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
> -};
> -
>  #ifdef CONFIG_DRM_XE_DEBUG_PAGE_SIZE
>  /**
>   * enum xe_page_size_alloc_ctrl_mode - User BO page-size allocation control modes
> @@ -538,14 +523,7 @@ struct xe_device {
>  	atomic_t in_reset;
>  
>  	/** @wedged: Struct to control Wedged States and mode */
> -	struct {
> -		/** @wedged.flag: Xe device faced a critical error and is now blocked. */
> -		atomic_t flag;
> -		/** @wedged.mode: Mode controlled by kernel parameter and debugfs */
> -		enum xe_wedged_mode mode;
> -		/** @wedged.inconsistent_reset: Inconsistent reset policy state between GTs */
> -		bool inconsistent_reset;
> -	} wedged;
> +	struct xe_wedge wedged;
>  
>  	/** @devres_group: devres group */
>  	void *devres_group;
> diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
> index 2bbe0f20ff8d..db669a953886 100644
> --- a/drivers/gpu/drm/xe/xe_gsc.c
> +++ b/drivers/gpu/drm/xe/xe_gsc.c
> @@ -31,6 +31,7 @@
>  #include "xe_sched_job.h"
>  #include "xe_uc_fw.h"
>  #include "xe_wa.h"
> +#include "xe_wedge.h"
>  #include "instructions/xe_gsc_commands.h"
>  #include "regs/xe_gsc_regs.h"
>  #include "regs/xe_gt_regs.h"
> @@ -340,8 +341,8 @@ static int gsc_er_complete(struct xe_gt *gt)
>  		 * declare the device as wedged.
>  		 */
>  		xe_gt_err(gt, "GSC ER timed out!\n");
> -		xe_device_declare_wedged(gt_to_xe(gt),
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(gt_to_xe(gt),
> +				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		return -EIO;
>  	}
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index f35ae3a532ee..ba1043476338 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -68,6 +68,7 @@
>  #include "xe_uc_fw.h"
>  #include "xe_vm.h"
>  #include "xe_wa.h"
> +#include "xe_wedge.h"
>  #include "xe_wopcm.h"
>  
>  #define GRDOM_RESET_TIMEOUT_MS	5
> @@ -933,7 +934,7 @@ static void gt_reset_worker(struct work_struct *w)
>  	unsigned int fw_ref;
>  	int err;
>  
> -	if (xe_device_wedged(gt_to_xe(gt)))
> +	if (xe_wedged(gt_to_xe(gt)))
>  		goto err_pm_put;
>  
>  	if (xe_device_is_in_reset(gt_to_xe(gt)))
> @@ -992,8 +993,7 @@ static void gt_reset_worker(struct work_struct *w)
>  
>  err_fail:
>  	xe_log_err_fatal(gt, GT, err, "reset failed\n");
> -	xe_device_declare_wedged(gt_to_xe(gt),
> -				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +	xe_wedge_declare(gt_to_xe(gt), DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  err_pm_put:
>  	xe_pm_runtime_put(gt_to_xe(gt));
>  }
> @@ -1021,7 +1021,7 @@ static void gt_wedge_worker(struct work_struct *w)
>  {
>  	struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
>  
> -	xe_uc_declare_wedged(&gt->uc);
> +	xe_uc_wedge_declare(&gt->uc);
>  	xe_tlb_inval_reset(&gt->tlb_inval);
>  }
>  
> @@ -1205,13 +1205,13 @@ struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
>  }
>  
>  /**
> - * xe_gt_declare_wedged() - Declare GT wedged
> + * xe_gt_wedge_declare() - Declare GT wedged
>   * @gt: the GT object
>   *
>   * Wedge the GT which stops all submission, saves desired debug state, and
>   * cleans up anything which could timeout.
>   */
> -void xe_gt_declare_wedged(struct xe_gt *gt)
> +void xe_gt_wedge_declare(struct xe_gt *gt)
>  {
>  	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt.h b/drivers/gpu/drm/xe/xe_gt.h
> index 92d934d50244..7b6952fe804c 100644
> --- a/drivers/gpu/drm/xe/xe_gt.h
> +++ b/drivers/gpu/drm/xe/xe_gt.h
> @@ -40,7 +40,7 @@ struct xe_gt *xe_gt_alloc(struct xe_tile *tile);
>  int xe_gt_init_early(struct xe_gt *gt);
>  int xe_gt_init(struct xe_gt *gt);
>  void xe_gt_mmio_init(struct xe_gt *gt);
> -void xe_gt_declare_wedged(struct xe_gt *gt);
> +void xe_gt_wedge_declare(struct xe_gt *gt);
>  int xe_gt_record_default_lrcs(struct xe_gt *gt);
>  
>  /**
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 28ec83bb8100..2a5f2064ad3e 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -37,6 +37,7 @@
>  #include "xe_tile_sriov_vf.h"
>  #include "xe_tlb_inval.h"
>  #include "xe_uc_fw.h"
> +#include "xe_wedge.h"
>  #include "xe_wopcm.h"
>  
>  #define make_u64_from_u32(hi, lo) ((u64)((u64)(u32)(hi) << 32 | (u32)(lo)))
> @@ -1462,7 +1463,7 @@ static void vf_post_migration_recovery(struct xe_gt *gt)
>  fail:
>  	vf_post_migration_abort(gt);
>  	xe_gt_sriov_err(gt, "migration recovery failed (%pe)\n", ERR_PTR(err));
> -	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  	return;
>  
>  queue:
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index 3ab4cb9e4964..7d239a0829fb 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -1829,13 +1829,13 @@ int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
>  }
>  
>  /**
> - * xe_guc_declare_wedged() - Declare GuC wedged
> + * xe_guc_wedge_declare() - Declare GuC wedged
>   * @guc: the GuC object
>   *
>   * Wedge the GuC which stops all submission, saves desired debug state, and
>   * cleans up anything which could timeout.
>   */
> -void xe_guc_declare_wedged(struct xe_guc *guc)
> +void xe_guc_wedge_declare(struct xe_guc *guc)
>  {
>  	xe_gt_assert(guc_to_gt(guc), guc_to_xe(guc)->wedged.mode);
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
> index c4eca40d69cf..75c4b9acb065 100644
> --- a/drivers/gpu/drm/xe/xe_guc.h
> +++ b/drivers/gpu/drm/xe/xe_guc.h
> @@ -62,7 +62,7 @@ void xe_guc_reset_wait(struct xe_guc *guc);
>  void xe_guc_stop_prepare(struct xe_guc *guc);
>  void xe_guc_stop(struct xe_guc *guc);
>  int xe_guc_start(struct xe_guc *guc);
> -void xe_guc_declare_wedged(struct xe_guc *guc);
> +void xe_guc_wedge_declare(struct xe_guc *guc);
>  bool xe_guc_using_main_gamctrl_queues(struct xe_guc *guc);
>  bool xe_guc_has_paging_engine(struct xe_guc *guc);
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index da5ce97484b8..7ab51c97f42a 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -36,6 +36,7 @@
>  #include "xe_sleep.h"
>  #include "xe_sriov_vf.h"
>  #include "xe_trace_guc.h"
> +#include "xe_wedge.h"
>  
>  static void receive_g2h(struct xe_guc_ct *ct);
>  static void g2h_worker_func(struct work_struct *w);
> @@ -1064,7 +1065,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_wedged(ct_to_xe(ct))) {
>  		ret = -ENOTRECOVERABLE;
>  		goto out;
>  	}
> @@ -1489,7 +1490,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
>  	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;
> +			ret = xe_wedged(ct_to_xe(ct)) ? -ENOTRECOVERABLE : -ECANCELED;
>  			goto unlock;
>  		}
>  		xe_gt_err(gt, "H2G request %#x failed: error %#x hint %#x\n",
> @@ -1828,7 +1829,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_wedged(xe))
>  		return -ENOTRECOVERABLE;
>  
>  	if (ct->state == XE_GUC_CT_STATE_DISABLED)
> diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
> index e0105222a2c7..9558d7196a51 100644
> --- a/drivers/gpu/drm/xe/xe_guc_pc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_pc.c
> @@ -36,6 +36,7 @@
>  #include "xe_pm.h"
>  #include "xe_sriov.h"
>  #include "xe_wa.h"
> +#include "xe_wedge.h"
>  
>  #define MCHBAR_MIRROR_BASE_SNB	0x140000
>  
> @@ -188,7 +189,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_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
>  		xe_gt_err(pc_to_gt(pc), "GuC PC reset failed: %pe\n",
>  			  ERR_PTR(ret));
>  
> @@ -212,7 +213,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_wedged(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 +236,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_wedged(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 +258,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_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
>  		xe_gt_err(pc_to_gt(pc), "GuC PC unset param failed: %pe",
>  			  ERR_PTR(ret));
>  
> @@ -1357,7 +1358,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_wedged(xe))
>  		return;
>  
>  	xe_guc_pc_stop(pc);
> diff --git a/drivers/gpu/drm/xe/xe_guc_rc.c b/drivers/gpu/drm/xe/xe_guc_rc.c
> index 99fa127b261f..fa3062ab134a 100644
> --- a/drivers/gpu/drm/xe/xe_guc_rc.c
> +++ b/drivers/gpu/drm/xe/xe_guc_rc.c
> @@ -16,6 +16,7 @@
>  #include "xe_guc_pc.h"
>  #include "xe_guc_rc.h"
>  #include "xe_pm.h"
> +#include "xe_wedge.h"
>  
>  /**
>   * DOC: GuC RC (Render C-states)
> @@ -40,7 +41,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_wedged(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 +74,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_wedged(xe))
>  		return;
>  
>  	CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT);
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index e2a0b989cfc8..d03fe282c3c8 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -50,6 +50,7 @@
>  #include "xe_trace.h"
>  #include "xe_uc_fw.h"
>  #include "xe_vm.h"
> +#include "xe_wedge.h"
>  
>  #define XE_GUC_EXEC_QUEUE_CGP_CONTEXT_ERROR_LEN		6
>  
> @@ -1450,10 +1451,10 @@ static bool guc_submit_hint_wedged(struct xe_guc *guc)
>  	if (xe->wedged.mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
>  		return false;
>  
> -	if (xe_device_wedged(xe))
> +	if (xe_wedged(xe))
>  		return true;
>  
> -	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  
>  	return true;
>  }
> @@ -1660,7 +1661,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
>  	if (!exec_queue_killed(q))
>  		wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
>  	else
> -		wedged = xe_device_wedged(xe);
> +		wedged = xe_wedged(xe);
>  
>  	/*
>  	 * Only tag as GPU hang if this is the original timeout, not a
> @@ -1780,8 +1781,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
>  	}
>  
>  	if (wedge_device)
> -		xe_device_declare_wedged(gt_to_xe(q->gt),
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(gt_to_xe(q->gt),
> +				 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  
>  	/*
>  	 * We want the job added back to the pending list so it gets freed; this
> @@ -2544,7 +2545,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_wedged(xe))
>  		return -EAGAIN;
>  
>  	if (!ret)
> @@ -2804,7 +2805,7 @@ 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)) ||
> +	wait_event(guc->ct.wq, xe_wedged(guc_to_xe(guc)) ||
>  		   !xe_guc_read_stopped(guc));
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
> index 111fef781b2a..dd38d95c6014 100644
> --- a/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
> +++ b/drivers/gpu/drm/xe/xe_guc_tlb_inval.c
> @@ -19,6 +19,7 @@
>  #include "xe_sa.h"
>  #include "xe_tlb_inval.h"
>  #include "xe_vm.h"
> +#include "xe_wedge.h"
>  
>  #include "regs/xe_guc_regs.h"
>  
> @@ -77,7 +78,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) && !xe_wedged(xe)) {
>  		struct xe_mmio *mmio = &gt->mmio;
>  
>  		if (IS_SRIOV_VF(xe))
> diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c
> index 934be933d57f..a2eae6088c1a 100644
> --- a/drivers/gpu/drm/xe/xe_mert.c
> +++ b/drivers/gpu/drm/xe/xe_mert.c
> @@ -11,6 +11,7 @@
>  #include "xe_mmio.h"
>  #include "xe_sriov_printk.h"
>  #include "xe_tile.h"
> +#include "xe_wedge.h"
>  
>  /**
>   * xe_mert_init_early() - Initialize MERT data
> @@ -74,8 +75,7 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	case CATERR_UNMAPPED_GGTT:
>  		xe_sriov_err(xe, "MERT: CAT_ERR: Access to an unmapped GGTT!\n");
> -		xe_device_declare_wedged(xe,
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	case CATERR_LMTT_FAULT:
>  		xe_sriov_dbg_ratelimited(xe, "MERT: CAT_ERR: VF%u LMTT fault!\n", vfid);
> @@ -83,8 +83,7 @@ static void mert_handle_cat_error(struct xe_device *xe)
>  		break;
>  	default:
>  		xe_sriov_err(xe, "MERT: Unexpected CAT_ERR code=%#x!\n", code);
> -		xe_device_declare_wedged(xe,
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		break;
>  	}
>  }
> diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
> index fdecd3e0b9a9..c64f403d1134 100644
> --- a/drivers/gpu/drm/xe/xe_pci_error.c
> +++ b/drivers/gpu/drm/xe/xe_pci_error.c
> @@ -13,6 +13,7 @@
>  #include "xe_printk.h"
>  #include "xe_ras.h"
>  #include "xe_survivability_mode.h"
> +#include "xe_wedge.h"
>  
>  static void prepare_device_for_reset(struct pci_dev *pdev)
>  {
> @@ -22,7 +23,7 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
>  
>  	/*
>  	 * 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
> +	 * xe_wedge_fini() releases runtime pm if wedged flag is set, so acquire a runtime
>  	 * pm reference to avoid underflow.
>  	 */
>  	if (!atomic_xchg(&xe->wedged.flag, 1))
> @@ -31,7 +32,7 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
>  	xe_device_set_in_reset(xe);
>  
>  	for_each_gt(gt, xe, id)
> -		xe_gt_declare_wedged(gt);
> +		xe_gt_wedge_declare(gt);
>  
>  	pci_disable_device(pdev);
>  }
> @@ -61,7 +62,7 @@ static pci_ers_result_t xe_pci_error_detected(struct pci_dev *pdev, pci_channel_
>  		return PCI_ERS_RESULT_DISCONNECT;
>  
>  	/* If the device is already wedged or in survivability mode, do not attempt recovery */
> -	if (xe_survivability_mode_is_boot_enabled(xe) || xe_device_wedged(xe))
> +	if (xe_survivability_mode_is_boot_enabled(xe) || xe_wedged(xe))
>  		return PCI_ERS_RESULT_DISCONNECT;
>  
>  	switch (state) {
> @@ -86,8 +87,7 @@ static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev)
>  
>  	/* User wants to debug the error, prevent reset */
>  	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> -		xe_device_declare_wedged(xe,
> -					 DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
> +		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>  		return PCI_ERS_RESULT_DISCONNECT;
>  	}
>  
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index fe16a4106060..922e5e793b13 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -16,6 +16,7 @@
>  #include "xe_sysctrl_event_types.h"
>  #include "xe_sysctrl_mailbox.h"
>  #include "xe_sysctrl_mailbox_types.h"
> +#include "xe_wedge.h"
>  
>  #define CORE_COMPUTE_UNCORR_TYPE	GENMASK(26, 25)
>  /*
> @@ -321,7 +322,7 @@ static u8 handle_core_compute_errors(struct xe_ras_error_array *arr)
>  
>  static void punit_error_handler(struct xe_device *xe)
>  {
> -	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
> +	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
>  }
>  
>  static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_array *arr)
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c
> index 33bd754d138f..ce0db26203ec 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c
> @@ -19,6 +19,7 @@
>  #include "xe_sriov_pf_service.h"
>  #include "xe_sriov_pf_sysfs.h"
>  #include "xe_sriov_printk.h"
> +#include "xe_wedge.h"
>  
>  static unsigned int wanted_max_vfs(struct xe_device *xe)
>  {
> @@ -157,7 +158,7 @@ int xe_sriov_pf_wait_ready(struct xe_device *xe)
>  	unsigned int id;
>  	int err;
>  
> -	if (xe_device_wedged(xe))
> +	if (xe_wedged(xe))
>  		return -ECANCELED;
>  
>  	for_each_gt(gt, xe, id) {
> diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
> index ca031576fecb..d73cdad0b3a9 100644
> --- a/drivers/gpu/drm/xe/xe_survivability_mode.c
> +++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
> @@ -20,6 +20,7 @@
>  #include "xe_pcode_api.h"
>  #include "xe_printk.h"
>  #include "xe_vsec.h"
> +#include "xe_wedge.h"
>  
>  /**
>   * DOC: Survivability Mode
> @@ -446,7 +447,7 @@ void xe_survivability_mode_runtime_enable(struct xe_device *xe)
>  	survivability->type = XE_SURVIVABILITY_TYPE_RUNTIME;
>  	xe_log_err(xe, SURVIVABILITY, 0, "Runtime Mode enabled!\n");
>  
> -	xe_device_declare_wedged(xe, DRM_WEDGE_RECOVERY_VENDOR);
> +	xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_VENDOR);
>  
>  	xe_log_err(xe, SURVIVABILITY, 0, "Firmware flash required!\n");
>  	xe_info(xe, "Please refer to the userspace documentation for more details how to flash the firmware on %s!\n",
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 65f59f06177f..686c28856014 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -326,15 +326,15 @@ void xe_uc_runtime_resume(struct xe_uc *uc)
>  }
>  
>  /**
> - * xe_uc_declare_wedged() - Declare UC wedged
> + * xe_uc_wedge_declare() - Declare UC wedged
>   * @uc: the UC object
>   *
>   * Wedge the UC which stops all submission, saves desired debug state, and
>   * cleans up anything which could timeout.
>   */
> -void xe_uc_declare_wedged(struct xe_uc *uc)
> +void xe_uc_wedge_declare(struct xe_uc *uc)
>  {
>  	xe_gt_assert(uc_to_gt(uc), uc_to_xe(uc)->wedged.mode);
>  
> -	xe_guc_declare_wedged(&uc->guc);
> +	xe_guc_wedge_declare(&uc->guc);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_uc.h b/drivers/gpu/drm/xe/xe_uc.h
> index 255a54a8f876..23bc0ce1c42f 100644
> --- a/drivers/gpu/drm/xe/xe_uc.h
> +++ b/drivers/gpu/drm/xe/xe_uc.h
> @@ -21,6 +21,6 @@ int xe_uc_start(struct xe_uc *uc);
>  void xe_uc_suspend_prepare(struct xe_uc *uc);
>  int xe_uc_suspend(struct xe_uc *uc);
>  int xe_uc_sanitize_reset(struct xe_uc *uc);
> -void xe_uc_declare_wedged(struct xe_uc *uc);
> +void xe_uc_wedge_declare(struct xe_uc *uc);
>  
>  #endif
> diff --git a/drivers/gpu/drm/xe/xe_wedge.c b/drivers/gpu/drm/xe/xe_wedge.c
> new file mode 100644
> index 000000000000..93ca2d3c0c68
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_wedge.c
> @@ -0,0 +1,261 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#include <drm/drm_drv.h>
> +#include <drm/drm_managed.h>
> +
> +#include "xe_defaults.h"
> +#include "xe_device.h"
> +#include "xe_gt.h"
> +#include "xe_gt_printk.h"
> +#include "xe_guc_ads.h"
> +#include "xe_log.h"
> +#include "xe_module.h"
> +#include "xe_pm.h"
> +#include "xe_printk.h"
> +#include "xe_sriov.h"
> +#include "xe_wedge.h"
> +
> +/**
> + * DOC: Xe Device Wedging
> + *
> + * Xe driver uses drm device wedged uevent as documented in Documentation/gpu/drm-uapi.rst.
> + * When device is in wedged state, every IOCTL will be blocked and GT cannot
> + * be used. The conditions under which the driver declares the device wedged
> + * depend on the wedge mode configuration (see &enum xe_wedged_mode). The
> + * default recovery method for a wedged state is rebind/bus-reset.
> + *
> + * Another recovery method is vendor-specific. Below are the cases that send
> + * ``WEDGED=vendor-specific`` recovery method in drm device wedged uevent.
> + *
> + * Case: Firmware Flash
> + * --------------------
> + *
> + * Identification Hint
> + * +++++++++++++++++++
> + *
> + * ``WEDGED=vendor-specific`` drm device wedged uevent with
> + * :ref:`Runtime Survivability mode <xe-survivability-mode>` is used to notify
> + * admin/userspace consumer about the need for a firmware flash.
> + *
> + * Recovery Procedure
> + * ++++++++++++++++++
> + *
> + * Once ``WEDGED=vendor-specific`` drm device wedged uevent is received, follow
> + * the below steps
> + *
> + * - Check Runtime Survivability mode sysfs.
> + *   If enabled, firmware flash is required to recover the device.
> + *
> + *   /sys/bus/pci/devices/<device>/survivability_mode
> + *
> + * - Admin/userspace consumer can use firmware flashing tools like fwupd to flash
> + *   firmware and restore device to normal operation.
> + */
> +
> +/**
> + * xe_wedged() - Check for wedged device
> + * @xe: xe device instance
> + *
> + * Returns: %true if device is wedged, %false otherwise.
> + */
> +bool xe_wedged(struct xe_device *xe)
> +{
> +	return atomic_read(&xe->wedged.flag);
> +}
> +
> +#define WEDGED_URL	"https://docs.kernel.org/gpu/drm-uapi.html#device-wedging"
> +#define XE_BUG_URL	"https://gitlab.freedesktop.org/drm/xe/kernel/issues/new"
> +
> +/**
> + * xe_wedge_declare() - Declare device wedged
> + * @xe: xe device instance
> + * @method: method(s) to be used for recovery
> + *
> + * This is a final state that can only be cleared with the recovery method
> + * specified in the drm wedged uevent. The method can be set using
> + * xe_wedge_set_method() before declaring the device as wedged.
> + * If no method is set, rebind/bus-reset will be sent by default.
> + *
> + * In this state every IOCTL will be blocked so the GT cannot be used.
> + * In general it will be called upon any critical error such as gt reset
> + * failure or guc loading failure. Userspace will be notified of this state
> + * through device wedged uevent.
> + * If xe.wedged module parameter is set to 2, this function will be called
> + * on every single execution timeout (a.k.a. GPU hang) right after devcoredump
> + * snapshot capture. In this mode, GT reset won't be attempted so the state of
> + * the issue is preserved for further debugging.
> + *
> + * Caller is expected to hold a runtime PM reference to avoid side-effects
> + * during wedge handling.
> + */
> +void xe_wedge_declare(struct xe_device *xe, unsigned long method)
> +{
> +	struct xe_gt *gt;
> +	u8 id;
> +
> +	if (xe->wedged.mode == XE_WEDGED_MODE_NEVER) {
> +		xe_dbg(xe, "Wedged mode is forcibly disabled\n");
> +		return;
> +	}
> +
> +	if (atomic_xchg(&xe->wedged.flag, 1))
> +		return;
> +
> +	xe->needs_flr_on_fini = true;
> +	xe_pm_runtime_get_noresume(xe);
> +
> +	xe_log_err_fatal(xe, WEDGED, -EIO, "Device declared wedged!\n");
> +	xe_err_once(xe, "IOCTLs and executions are now blocked!\n"
> +			"For recovery procedure, refer to %s\n"
> +			"Please file a _new_ bug report at %s\n",
> +			WEDGED_URL, XE_BUG_URL);
> +
> +	for_each_initialized_gt(gt, xe, id)
> +		xe_gt_wedge_declare(gt);
> +
> +	/*
> +	 * XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET is intended for debugging
> +	 * hangs, so wedge the device with 'none' recovery method and have
> +	 * it available to the user for debugging.
> +	 */
> +	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
> +		method = DRM_WEDGE_RECOVERY_NONE;
> +
> +	/* Notify userspace of wedged device */
> +	drm_dev_wedged_event(&xe->drm, method, NULL);
> +}
> +
> +static const char *wedge_mode_to_string(enum xe_wedged_mode mode)
> +{
> +	switch (mode) {
> +	case XE_WEDGED_MODE_NEVER:
> +		return "never";
> +	case XE_WEDGED_MODE_UPON_CRITICAL_ERROR:
> +		return "upon-critical-error";
> +	case XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET:
> +		return "upon-any-hang-no-reset";
> +	default:
> +		return "<invalid>";
> +	}
> +}
> +
> +static int wedge_validate_mode(struct xe_device *xe, unsigned int mode)
> +{
> +	if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> +		xe_dbg(xe, "wedged_mode: invalid value (%u)\n", mode);
> +		return -EINVAL;
> +	} else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
> +		   (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
> +		xe_dbg(xe, "wedged_mode: (%u) %s mode is not supported for %s\n",
> +		       mode, wedge_mode_to_string(mode),
> +		       xe_sriov_mode_to_string(xe_device_sriov_mode(xe)));
> +		return -EPERM;
> +	}
> +
> +	return 0;
> +}
> +
> +static bool wedge_mode_needs_policy_update(struct xe_device *xe, enum xe_wedged_mode mode)
> +{
> +	if (xe->wedged.inconsistent_reset)
> +		return true;
> +
> +	if (xe->wedged.mode == mode)
> +		return false;
> +
> +	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET ||
> +	    mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET)
> +		return true;
> +
> +	return false;
> +}
> +
> +static int __wedge_mode_set_reset_policy(struct xe_gt *gt, enum xe_wedged_mode mode)
> +{
> +	bool enable_engine_reset;
> +	int ret;
> +
> +	enable_engine_reset = (mode != XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET);
> +	ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads,
> +						       enable_engine_reset);
> +	if (ret)
> +		xe_gt_err(gt, "Failed to update GuC ADS scheduler policy (%pe)\n", ERR_PTR(ret));
> +
> +	return ret;
> +}
> +
> +static int wedge_mode_set_reset_policy(struct xe_device *xe, enum xe_wedged_mode mode)
> +{
> +	struct xe_gt *gt;
> +	int ret;
> +	u8 id;
> +
> +	guard(xe_pm_runtime)(xe);
> +	for_each_gt(gt, xe, id) {
> +		ret = __wedge_mode_set_reset_policy(gt, mode);
> +		if (ret) {
> +			if (id > 0) {
> +				xe->wedged.inconsistent_reset = true;
> +				xe_err(xe, "Inconsistent reset policy state between GTs\n");
> +			}
> +			return ret;
> +		}
> +	}
> +
> +	xe->wedged.inconsistent_reset = false;
> +
> +	return 0;
> +}
> +
> +/**
> + * xe_wedge_set_mode() - Set wedge mode
> + * @xe: xe device instance
> + * @mode: wedge mode to be set
> + *
> + * Returns: 0 on success, negative error code otherwise.
> + */
> +int xe_wedge_set_mode(struct xe_device *xe, enum xe_wedged_mode mode)
> +{
> +	int ret;
> +
> +	ret = wedge_validate_mode(xe, mode);
> +	if (ret)
> +		return ret;
> +
> +	if (wedge_mode_needs_policy_update(xe, mode)) {
> +		ret = wedge_mode_set_reset_policy(xe, mode);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	xe->wedged.mode = mode;
> +
> +	return ret;
> +}
> +
> +static void xe_wedge_fini(struct drm_device *drm, void *arg)
> +{
> +	struct xe_device *xe = arg;
> +
> +	if (atomic_read(&xe->wedged.flag))
> +		xe_pm_runtime_put(xe);
> +}
> +
> +/**
> + * xe_wedge_init() - Initialize wedge
> + * @xe: xe device instance
> + *
> + * Returns: 0 on success, negative error code otherwise.
> + */
> +int xe_wedge_init(struct xe_device *xe)
> +{
> +	xe->wedged.mode = wedge_validate_mode(xe, xe_modparam.wedged_mode) ?
> +			  XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
> +	xe_dbg(xe, "wedged_mode: setting mode (%u) %s\n",
> +	       xe->wedged.mode, wedge_mode_to_string(xe->wedged.mode));
> +
> +	return drmm_add_action_or_reset(&xe->drm, xe_wedge_fini, xe);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_wedge.h b/drivers/gpu/drm/xe/xe_wedge.h
> new file mode 100644
> index 000000000000..5fda8ce015d4
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_wedge.h
> @@ -0,0 +1,19 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_WEDGE_H_
> +#define _XE_WEDGE_H_
> +
> +#include <linux/types.h>
> +
> +struct xe_device;
> +enum xe_wedged_mode;
> +
> +bool xe_wedged(struct xe_device *xe);
> +void xe_wedge_declare(struct xe_device *xe, unsigned long method);
> +int xe_wedge_init(struct xe_device *xe);
> +int xe_wedge_set_mode(struct xe_device *xe, enum xe_wedged_mode mode);
> +
> +#endif
> diff --git a/drivers/gpu/drm/xe/xe_wedge_types.h b/drivers/gpu/drm/xe/xe_wedge_types.h
> new file mode 100644
> index 000000000000..1b66df31013e
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_wedge_types.h
> @@ -0,0 +1,39 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_WEDGE_TYPES_H_
> +#define _XE_WEDGE_TYPES_H_
> +
> +#include <linux/types.h>
> +
> +/**
> + * enum xe_wedged_mode - Possible wedge modes
> + * @XE_WEDGED_MODE_NEVER: Device will never be declared wedged.
> + * @XE_WEDGED_MODE_UPON_CRITICAL_ERROR: Device will be declared wedged only
> + *	when critical error occurs like GT reset failure or firmware failure.
> + *	This is the default mode.
> + * @XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET: Device will be declared wedged on
> + *	any hang. In this mode, engine resets are disabled to avoid automatic
> + *	recovery attempts. This mode is primarily intended for debugging hangs.
> + */
> +enum xe_wedged_mode {
> +	XE_WEDGED_MODE_NEVER = 0,
> +	XE_WEDGED_MODE_UPON_CRITICAL_ERROR = 1,
> +	XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
> +};
> +
> +/**
> + * struct xe_wedge - Struct to control Wedged States and mode
> + */
> +struct xe_wedge {
> +	/** @flag: Xe device faced a critical error and is now blocked. */
> +	atomic_t flag;
> +	/** @mode: Mode controlled by kernel parameter and debugfs */
> +	enum xe_wedged_mode mode;
> +	/** @inconsistent_reset: Inconsistent reset policy state between GTs */
> +	bool inconsistent_reset;
> +};
> +
> +#endif
> -- 
> 2.43.0
> 

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

* Re: [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging
  2026-10-13 18:29   ` Rodrigo Vivi
@ 2026-10-13 18:49     ` Matthew Brost
  0 siblings, 0 replies; 17+ messages in thread
From: Matthew Brost @ 2026-10-13 18:49 UTC (permalink / raw)
  To: Rodrigo Vivi
  Cc: Raag Jadav, intel-xe, riana.tauro, michal.wajdeczko,
	lukasz.laguna, matthew.d.roper, mallesh.koujalagi

On Tue, Oct 13, 2026 at 02:29:12PM -0400, Rodrigo Vivi wrote:
> On Tue, Oct 13, 2026 at 04:33:53PM +0530, Raag Jadav wrote:
> > Currently, xe_gt_declare_wedged() stops GuC CT and initiates exec queue
> > teardown synchronously. This can result in tdr timeout in cases where
> > the device is declared wedged while jobs are still in-flight.
> > 
> > Introduce a worker for GT specific wedge handling and queue the teardown
> > on GT ordered workqueue, so we don't disrupt the scheduler while jobs
> > are still in-flight.
> > 
> > While at it, introduce for_each_initialized_gt() macro and use it for
> > wedging GT. This helps avoid races in case the device is declared wedged
> > in probe sequence before GT is initialized.
> > 
> > Fixes: c9474b726b93 ("drm/xe: Wedge the entire device")
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> > v2: Split fixes into separate patches (Rodrigo, Michal)
> > v4: Introduce for_each_initialized_gt() (Michal)
> > v5: Flush GT wedge worker to avoid races (Sashiko)
> > ---
> >  drivers/gpu/drm/xe/xe_device.c   |  2 +-
> >  drivers/gpu/drm/xe/xe_device.h   |  4 ++++
> >  drivers/gpu/drm/xe/xe_gt.c       | 18 ++++++++++++++++--
> >  drivers/gpu/drm/xe/xe_gt_types.h |  9 +++++++++
> >  4 files changed, 30 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > index 8392c9fad3c4..22ae10958d7f 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -1432,7 +1432,7 @@ void xe_device_declare_wedged(struct xe_device *xe)
> >  			    WEDGED_URL, XE_BUG_URL);
> >  	}
> >  
> > -	for_each_gt(gt, xe, id)
> > +	for_each_initialized_gt(gt, xe, id)
> >  		xe_gt_declare_wedged(gt);
> >  
> >  	if (xe_device_wedged(xe)) {
> > diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> > index 83d6dafab53c..80bda9b548d5 100644
> > --- a/drivers/gpu/drm/xe/xe_device.h
> > +++ b/drivers/gpu/drm/xe/xe_device.h
> > @@ -139,6 +139,10 @@ static inline bool xe_device_uc_enabled(struct xe_device *xe)
> >  	for_each_gt((gt__), (tile__)->xe, (id__)) \
> >  		for_each_if((gt__)->tile == (tile__))
> >  
> > +#define for_each_initialized_gt(gt__, xe__, id__) \
> > +	for_each_gt((gt__), (xe__), (id__)) \
> > +		for_each_if(READ_ONCE((gt__)->initialized))
> > +
> >  static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
> >  {
> >  	return &gt->pm.fw;
> > diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> > index 775c826b68b4..4e047cfaf603 100644
> > --- a/drivers/gpu/drm/xe/xe_gt.c
> > +++ b/drivers/gpu/drm/xe/xe_gt.c
> > @@ -175,6 +175,7 @@ static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt)
> >  }
> >  
> >  static void gt_reset_worker(struct work_struct *w);
> > +static void gt_wedge_worker(struct work_struct *w);
> >  
> >  static int emit_job_sync(struct xe_exec_queue *q, struct xe_bb *bb,
> >  			 long timeout_jiffies, bool force_reset)
> > @@ -706,6 +707,8 @@ static void xe_gt_fini(void *arg)
> >  	struct xe_gt *gt = arg;
> >  	int i;
> >  
> > +	disable_work_sync(&gt->wedge.worker);
> > +
> >  	if (disable_work_sync(&gt->reset.worker))
> >  		/*
> >  		 * If gt_reset_worker was halted from executing, take care of
> > @@ -725,6 +728,7 @@ int xe_gt_init(struct xe_gt *gt)
> >  	int i;
> >  
> >  	INIT_WORK(&gt->reset.worker, gt_reset_worker);
> > +	INIT_WORK(&gt->wedge.worker, gt_wedge_worker);
> 
> perhaps this should be in the gt_alloc or some init early?
> 
> >  
> >  	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i) {
> >  		gt->ring_ops[i] = xe_ring_ops_get(gt, i);
> > @@ -769,6 +773,8 @@ int xe_gt_init(struct xe_gt *gt)
> >  			return err;
> >  	}
> >  
> > +	/* Must be last */
> > +	WRITE_ONCE(gt->initialized, true);
> >  	return 0;
> >  }
> >  
> > @@ -1010,6 +1016,14 @@ void xe_gt_reset_async(struct xe_gt *gt)
> >  		xe_pm_runtime_put(xe);
> >  }
> >  
> > +static void gt_wedge_worker(struct work_struct *w)
> > +{
> > +	struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
> > +
> > +	xe_uc_declare_wedged(&gt->uc);
> > +	xe_tlb_inval_reset(&gt->tlb_inval);
> > +}
> > +
> >  void xe_gt_suspend_prepare(struct xe_gt *gt)
> >  {
> >  	xe_uc_suspend_prepare(&gt->uc);
> > @@ -1200,6 +1214,6 @@ void xe_gt_declare_wedged(struct xe_gt *gt)
> >  {
> >  	xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
> >  
> > -	xe_uc_declare_wedged(&gt->uc);
> > -	xe_tlb_inval_reset(&gt->tlb_inval);
> > +	queue_work(gt->ordered_wq, &gt->wedge.worker);
> > +	flush_work(&gt->wedge.worker);
> 
> This flush serialize things, but apparently it deadlock somewhere else now.
> Perhaps we should avoid this one here and instead flush for each gt in
> pci disable case.
> 

Good catch - I misssed this.

Yeah, flushes are always dangerous. I'm guessing the deadlock is because
some locks can be held here that are also taken on `gt->ordered_wq`.
This code can be called from IRQ context, from the ordered workqueue
itself, or from the DRM scheduler submit worker. All of those
possibilities are problematic, and even if we somehow got this right
today, we'd probably break it again later.

In any case, I agree that we should drop the flush here. If we need to
serialize against this work being in flight, let's add a serialization
point elsewhere and, in teardown paths, disable the wedge work item
(although I haven't fully thought that part through).

I suspect that any path requiring wedge serialization also needs to
serialize against an in-flight GT reset, VF migration, etc., and we may
be missing code to handle those cases today.

Matt

> >  }
> > diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
> > index 628911346455..c00a7c171f80 100644
> > --- a/drivers/gpu/drm/xe/xe_gt_types.h
> > +++ b/drivers/gpu/drm/xe/xe_gt_types.h
> > @@ -233,6 +233,12 @@ struct xe_gt {
> >  		struct work_struct worker;
> >  	} reset;
> >  
> > +	/** @wedge: state for GT wedge */
> > +	struct {
> > +		/** @wedge.worker: worker for GT wedge to be done async */
> > +		struct work_struct worker;
> > +	} wedge;
> > +
> >  	/** @tlb_inval: TLB invalidation state */
> >  	struct xe_tlb_inval tlb_inval;
> >  
> > @@ -419,6 +425,9 @@ struct xe_gt {
> >  
> >  	/** @eu_stall: EU stall counters subsystem per gt info */
> >  	struct xe_eu_stall_gt *eu_stall;
> > +
> > +	/** @initialized: GT is initialized */
> > +	bool initialized;
> >  };
> >  
> >  #endif
> > -- 
> > 2.43.0
> > 

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

end of thread, other threads:[~2026-10-13 18:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 11:03 [PATCH v5 0/5] Introduce xe_wedge Raag Jadav
2026-10-13 11:03 ` [PATCH v5 1/5] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
2026-10-13 11:19   ` sashiko-bot
2026-10-13 18:29   ` Rodrigo Vivi
2026-10-13 18:49     ` Matthew Brost
2026-10-13 11:03 ` [PATCH v5 2/5] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
2026-10-13 11:20   ` sashiko-bot
2026-10-13 18:30   ` Rodrigo Vivi
2026-10-13 11:03 ` [PATCH v5 3/5] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Raag Jadav
2026-10-13 11:03 ` [PATCH v5 4/5] drm/xe: Introduce xe_wedge Raag Jadav
2026-10-13 11:16   ` sashiko-bot
2026-10-13 18:32   ` Rodrigo Vivi
2026-10-13 11:03 ` [PATCH v5 5/5] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
2026-10-13 11:22   ` sashiko-bot
2026-10-13 11:12 ` ✗ CI.checkpatch: warning for Introduce xe_wedge (rev4) Patchwork
2026-10-13 11:14 ` ✓ CI.KUnit: success " Patchwork
2026-10-13 15:40 ` ✓ Xe.CI.BAT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.