Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhanjun Dong <zhanjun.dong@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Zhanjun Dong <zhanjun.dong@intel.com>
Subject: [PATCH v6 4/6] drm/xe: Use XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET enum instead of magic number
Date: Wed, 11 Feb 2026 17:20:18 -0500	[thread overview]
Message-ID: <20260211222020.848341-5-zhanjun.dong@intel.com> (raw)
In-Reply-To: <20260211222020.848341-1-zhanjun.dong@intel.com>

Replace the magic number 2 with the proper enum value
XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET for better code readability
and maintainability.

Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 91c7600a59f5..cd434caec9c2 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1334,12 +1334,13 @@ void xe_guc_submit_wedge(struct xe_guc *guc)
 	if (!guc->submission_state.initialized)
 		return;
 
-	if (xe->wedged.mode == 2) {
+	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
 		err = devm_add_action_or_reset(guc_to_xe(guc)->drm.dev,
 					       guc_submit_wedged_fini, guc);
 		if (err) {
-			xe_gt_err(gt, "Failed to register clean-up on wedged.mode=2; "
-				  "Although device is wedged.\n");
+			xe_gt_err(gt, "Failed to register clean-up on wedged.mode=%s; "
+				  "Although device is wedged.\n",
+				  xe_wedged_mode_to_string(XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET));
 			return;
 		}
 
-- 
2.34.1


  parent reply	other threads:[~2026-02-11 22:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 22:20 [PATCH v6 0/6] Attempt to fixup reset, wedge, unload corner cases Zhanjun Dong
2026-02-11 22:20 ` [PATCH v6 1/6] drm/xe: Always kill exec queues in xe_guc_submit_pause_abort Zhanjun Dong
2026-02-11 22:20 ` [PATCH v6 2/6] drm/xe: Forcefully tear down exec queues in GuC submit fini Zhanjun Dong
2026-02-11 22:20 ` [PATCH v6 3/6] drm/xe: Trigger queue cleanup if not in wedged mode 2 Zhanjun Dong
2026-02-11 22:20 ` Zhanjun Dong [this message]
2026-02-11 22:20 ` [PATCH v6 5/6] drm/xe/guc: Ensure CT state transitions via STOP before DISABLED Zhanjun Dong
2026-02-11 22:20 ` [PATCH v6 6/6] drm/xe/uc: Drop xe_guc_sanitize in favor of managed cleanup Zhanjun Dong
2026-02-11 22:27 ` ✓ CI.KUnit: success for Attempt to fixup reset, wedge, unload corner cases Patchwork
2026-02-11 23:02 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-13  5:44 ` ✗ Xe.CI.FULL: failure " 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=20260211222020.848341-5-zhanjun.dong@intel.com \
    --to=zhanjun.dong@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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