public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: matthew.brost@intel.com, rodrigo.vivi@intel.com,
	riana.tauro@intel.com, michal.wajdeczko@intel.com,
	matthew.d.roper@intel.com, umesh.nerlige.ramappa@intel.com,
	mallesh.koujalagi@intel.com, Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 3/4] drm/xe/hw_error: Allow debugging hardware errors
Date: Thu,  2 Apr 2026 23:12:28 +0530	[thread overview]
Message-ID: <20260402174229.1062874-4-raag.jadav@intel.com> (raw)
In-Reply-To: <20260402174229.1062874-1-raag.jadav@intel.com>

Hardware errors are reported through System Controller on the platforms
that support it, and never routed as direct IRQ to SGUnit other than
debug cases. Wedge the device on XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET
so that the hardware errors are available to the user for debugging.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
v2: Explain the usecase (Matt Roper)
---
 drivers/gpu/drm/xe/xe_hw_error.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
index c7b720ba5a4f..79a85925a02f 100644
--- a/drivers/gpu/drm/xe/xe_hw_error.c
+++ b/drivers/gpu/drm/xe/xe_hw_error.c
@@ -169,11 +169,14 @@ static void hw_error_work(struct work_struct *work)
 {
 	struct xe_tile *tile = container_of(work, typeof(*tile), hw_error_work);
 	struct xe_device *xe = tile_to_xe(tile);
-	int ret;
+	bool wedge = xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET;
 
-	ret = xe_survivability_mode_runtime_enable(xe);
-	if (ret)
-		drm_err(&xe->drm, "Failed to enable runtime survivability mode\n");
+	if (wedge) {
+		xe_device_declare_wedged(xe);
+		return;
+	}
+
+	xe_survivability_mode_runtime_enable(xe);
 }
 
 static void csc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)
@@ -433,6 +436,19 @@ static void hw_error_source_handler(struct xe_tile *tile, const enum hardware_er
 	if (!IS_DGFX(xe))
 		return;
 
+	if (xe->info.has_sysctrl) {
+		/*
+		 * Hardware errors are reported through System Controller on the platforms that
+		 * support it, so we should never be here other than debug cases. Retain the
+		 * hardware state and bail without clearing error registers, so that they are
+		 * available to the user for debugging.
+		 */
+		drm_err_ratelimited(&xe->drm, HW_ERR "Tile%d reported %s error\n",
+				    tile->id, severity_str);
+		schedule_work(&tile->hw_error_work);
+		return;
+	}
+
 	spin_lock_irqsave(&xe->irq.lock, flags);
 	err_src = xe_mmio_read32(&tile->mmio, DEV_ERR_STAT_REG(hw_err));
 	if (!err_src) {
-- 
2.43.0


  parent reply	other threads:[~2026-04-02 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 17:42 [PATCH v2 0/4] Hardware Error handling for Crescent Island Raag Jadav
2026-04-02 17:42 ` [PATCH v2 1/4] drm/xe/hw_error: Setup hardware error routing Raag Jadav
2026-04-02 17:42 ` [PATCH v2 2/4] drm/xe/hw_error: Reuse CSC worker for generic error handling Raag Jadav
2026-04-02 17:42 ` Raag Jadav [this message]
2026-04-02 17:42 ` [PATCH v2 4/4] drm/xe/debugfs: Update hardware error routing with wedged.mode Raag Jadav
2026-04-02 17:53 ` ✓ CI.KUnit: success for Hardware Error handling for Crescent Island (rev2) Patchwork
2026-04-02 18:43 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-03  6:37 ` ✓ Xe.CI.FULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260402174229.1062874-4-raag.jadav@intel.com \
    --to=raag.jadav@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=umesh.nerlige.ramappa@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox