All of lore.kernel.org
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: daniele.ceraolospurio@intel.com, michal.wajdeczko@intel.com,
	aravind.iddamsetty@intel.com, mallesh.koujalagi@intel.com,
	alan.previn.teres.alexis@intel.com, julia.filipchuk@intel.com
Subject: [PATCH v5 2/7] drm/xe/guc: Handle CRASH and EXCEPTION G2H with separate helpers
Date: Fri, 18 Sep 2026 22:00:58 -0700	[thread overview]
Message-ID: <20260919050055.2092579-11-umesh.nerlige.ramappa@intel.com> (raw)
In-Reply-To: <20260919050055.2092579-9-umesh.nerlige.ramappa@intel.com>

Refactor to handle the CRASH and EXCEPTION G2H separately. In the
process drop the else case that existed earlier but was unreachable
code.

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
---
v2: return 0 from the helpers to retain old behavior (Sashiko)
---
 drivers/gpu/drm/xe/xe_guc_ct.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index 5c4733da385c..b3a6aa37808b 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -1553,22 +1553,22 @@ static int parse_g2h_event(struct xe_guc_ct *ct, u32 *msg, u32 len)
 	return 0;
 }
 
-static int guc_crash_process_msg(struct xe_guc_ct *ct, u32 action)
+static int guc_handle_crash_dump_msg(struct xe_guc_ct *ct, u32 action)
 {
-	struct xe_gt *gt = ct_to_gt(ct);
+	xe_gt_err(ct_to_gt(ct), "GuC Crash dump notification\n");
+	CT_DEAD(ct, NULL, CRASH);
+	kick_reset(ct);
 
-	if (action == XE_GUC_ACTION_NOTIFY_CRASH_DUMP_POSTED)
-		xe_gt_err(gt, "GuC Crash dump notification\n");
-	else if (action == XE_GUC_ACTION_NOTIFY_EXCEPTION)
-		xe_gt_err(gt, "GuC Exception notification\n");
-	else
-		xe_gt_err(gt, "Unknown GuC crash notification: 0x%04X\n", action);
+	return -EHOSTDOWN;
+}
 
+static int guc_handle_exception_msg(struct xe_guc_ct *ct, u32 action)
+{
+	xe_gt_err(ct_to_gt(ct), "GuC Exception notification\n");
 	CT_DEAD(ct, NULL, CRASH);
-
 	kick_reset(ct);
 
-	return 0;
+	return -EHOSTDOWN;
 }
 
 static int parse_g2h_response(struct xe_guc_ct *ct, u32 *msg, u32 len)
@@ -1772,8 +1772,10 @@ static int process_g2h_msg(struct xe_guc_ct *ct, u32 *msg, u32 len)
 		ret = xe_gt_sriov_pf_monitor_process_guc2pf(gt, hxg, hxg_len);
 		break;
 	case XE_GUC_ACTION_NOTIFY_CRASH_DUMP_POSTED:
+		ret = guc_handle_crash_dump_msg(ct, action);
+		break;
 	case XE_GUC_ACTION_NOTIFY_EXCEPTION:
-		ret = guc_crash_process_msg(ct, action);
+		ret = guc_handle_exception_msg(ct, action);
 		break;
 #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
 	case XE_GUC_ACTION_TEST_G2G_RECV:
-- 
2.55.0


  parent reply	other threads:[~2026-09-19  5:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  5:00 [PATCH v5 0/7] Use SIG_ID logs for GuC component Umesh Nerlige Ramappa
2026-09-19  5:00 ` [PATCH v5 1/7] drm/xe/guc: Use different error codes for GuC load errors Umesh Nerlige Ramappa
2026-09-19  5:00 ` Umesh Nerlige Ramappa [this message]
2026-09-19  5:09   ` [PATCH v5 2/7] drm/xe/guc: Handle CRASH and EXCEPTION G2H with separate helpers sashiko-bot
2026-09-19  5:00 ` [PATCH v5 3/7] drm/xe/guc: Make ct_dead_capture available on non-debug config Umesh Nerlige Ramappa
2026-09-19  5:01 ` [PATCH v5 4/7] drm/xe/guc: Cleanup error codes and handling for CT errors Umesh Nerlige Ramappa
2026-09-19  5:14   ` sashiko-bot
2026-09-19  5:01 ` [PATCH v5 5/7] drm/xe/uc: Report DMA failure using SIGID Umesh Nerlige Ramappa
2026-09-19  5:01 ` [PATCH v5 6/7] drm/xe/guc: Report major GuC failures " Umesh Nerlige Ramappa
2026-09-19  5:01 ` [PATCH v5 7/7] drm/xe/guc: Report errors that cause a CT shutdown " Umesh Nerlige Ramappa
2026-09-19  5:07 ` ✗ CI.checkpatch: warning for Use SIG_ID logs for GuC component (rev4) Patchwork
2026-09-19  5:09 ` ✓ CI.KUnit: success " Patchwork
2026-09-19  5:48 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-09-19  8:33 ` ✗ 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=20260919050055.2092579-11-umesh.nerlige.ramappa@intel.com \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=julia.filipchuk@intel.com \
    --cc=mallesh.koujalagi@intel.com \
    --cc=michal.wajdeczko@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 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.