dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability
@ 2026-11-02 22:26 Alan Previn
  2026-11-02 22:33 ` sashiko-bot
  2026-11-03  6:29 ` Tauro, Riana
  0 siblings, 2 replies; 19+ messages in thread
From: Alan Previn @ 2026-11-02 22:26 UTC (permalink / raw)
  To: intel-xe; +Cc: Alan Previn, dri-devel, Raag Jadav, Riana Tauro

When user requests to enter survivabilty via configfs, or if
check_boot_failure is hit inside xe_survivability_mode_is_requested,
no indication is published. This patch adds some awareness in dmesg.

 v4 : - Remove logs from enable_boot_survivability_mode to avoid
        duplication (Riana + Sashiko).
      - Rename xe_survivability_mode_is_requested to
        xe_survivability_mode_is_required since it checks fw state
        on top of configfs request. Refactor to avoid duplicated logs.
 v3 : - Limit message to xe_survivability_mode_is_requested. (Riana)
 v2 : - Remove / modify messages to reflect underlying behavior. (Sashiko)

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c             |  2 +-
 drivers/gpu/drm/xe/xe_survivability_mode.c | 46 +++++++++++++---------
 drivers/gpu/drm/xe/xe_survivability_mode.h |  2 +-
 3 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 07a7ab6ac083..608309745328 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -735,7 +735,7 @@ int xe_device_probe_early(struct xe_device *xe)
 	 * the driver will be blocked
 	 */
 	err = xe_pcode_probe_early(xe);
-	if (err || xe_survivability_mode_is_requested(xe)) {
+	if (err || xe_survivability_mode_is_required(xe)) {
 		int save_err = err;
 
 		/*
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index d73cdad0b3a9..0650bbca5f5d 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -364,11 +364,6 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev)
 	if (ret)
 		goto failed;
 
-	if (check_boot_failure(xe))
-		xe_log_err_fatal(pdev, SURVIVABILITY, 0, "Boot Mode enabled!\n");
-	else
-		xe_log_info(pdev, SURVIVABILITY, "Boot Mode enabled!\n");
-
 	return 0;
 
 failed:
@@ -390,17 +385,7 @@ bool xe_survivability_mode_is_boot_enabled(struct xe_device *xe)
 	return survivability->mode && survivability->type == XE_SURVIVABILITY_TYPE_BOOT;
 }
 
-/**
- * xe_survivability_mode_is_requested - check if it's possible to enable survivability
- *					mode that was requested by firmware or userspace
- * @xe: xe device instance
- *
- * This function reads configfs and  boot status from Pcode.
- *
- * Return: true if platform support is available and boot status indicates
- * failure or if survivability mode is requested, false otherwise.
- */
-bool xe_survivability_mode_is_requested(struct xe_device *xe)
+static bool survivability_mode_required(struct xe_device *xe, bool log_on_action)
 {
 	struct xe_survivability *survivability = &xe->survivability;
 	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
@@ -413,13 +398,36 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
 
 	survivability_mode = xe_configfs_get_survivability_mode(pdev);
 	/* Enable survivability mode if set via configfs */
-	if (survivability_mode)
+	if (survivability_mode) {
+		if (log_on_action)
+			xe_log_info(xe, SURVIVABILITY, "Boot mode requested.\n");
 		return true;
+	}
 
 	data = xe_mmio_read32(mmio, PCODE_SCRATCH(0));
 	survivability->boot_status = REG_FIELD_GET(BOOT_STATUS, data);
 
-	return check_boot_failure(xe);
+	if (check_boot_failure(xe)) {
+		if (log_on_action)
+			xe_log_err_fatal(pdev, SURVIVABILITY, 0, "Boot Mode required!\n");
+		return true;
+	}
+	return false;
+}
+
+/**
+ * xe_survivability_mode_is_required - check if survivability mode is required based on
+ *                                     state of firmware or userspace request.
+ * @xe: xe device instance
+ *
+ * This function reads configfs and boot status from Pcode.
+ *
+ * Return: true if platform support is available and boot status indicates
+ * failure or if survivability mode is requested, false otherwise.
+ */
+bool xe_survivability_mode_is_required(struct xe_device *xe)
+{
+	return survivability_mode_required(xe, true);
 }
 
 /**
@@ -468,7 +476,7 @@ int xe_survivability_mode_boot_enable(struct xe_device *xe)
 	struct xe_survivability *survivability = &xe->survivability;
 	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
 
-	if (!xe_survivability_mode_is_requested(xe))
+	if (!survivability_mode_required(xe, false))
 		return 0;
 
 	populate_survivability_info(xe);
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.h b/drivers/gpu/drm/xe/xe_survivability_mode.h
index cd040e4d18bb..a68f071a8055 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.h
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.h
@@ -13,6 +13,6 @@ struct xe_device;
 int xe_survivability_mode_boot_enable(struct xe_device *xe);
 void xe_survivability_mode_runtime_enable(struct xe_device *xe);
 bool xe_survivability_mode_is_boot_enabled(struct xe_device *xe);
-bool xe_survivability_mode_is_requested(struct xe_device *xe);
+bool xe_survivability_mode_is_required(struct xe_device *xe);
 
 #endif /* _XE_SURVIVABILITY_MODE_H_ */

base-commit: 2cd78713d917a02987f21b437561a5e1e13ddda2
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability
@ 2026-11-02 22:19 Alan Previn
  2026-11-02 22:27 ` sashiko-bot
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Previn @ 2026-11-02 22:19 UTC (permalink / raw)
  To: intel-xe; +Cc: Alan Previn, dri-devel, Raag Jadav, Riana Tauro

When user requests to enter survivabilty via configfs, or if
check_boot_failure is hit inside xe_survivability_mode_is_requested,
no indication is published. This patch adds some awareness in dmesg.

 v4 : - Remove logs from enable_boot_survivability_mode to avoid
        duplication (Riana + Sashiko).
      - Rename xe_survivability_mode_is_requested to
        xe_survivability_mode_is_required since it checks fw state
        on top of configfs request. Refactor to avoid duplicated logs.
 v3 : - Limit message to xe_survivability_mode_is_requested. (Riana)
 v2 : - Remove / modify messages to reflect underlying behavior. (Sashiko)

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c             |  2 +-
 drivers/gpu/drm/xe/xe_survivability_mode.c | 46 +++++++++++++---------
 drivers/gpu/drm/xe/xe_survivability_mode.h |  2 +-
 3 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 07a7ab6ac083..608309745328 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -735,7 +735,7 @@ int xe_device_probe_early(struct xe_device *xe)
 	 * the driver will be blocked
 	 */
 	err = xe_pcode_probe_early(xe);
-	if (err || xe_survivability_mode_is_requested(xe)) {
+	if (err || xe_survivability_mode_is_required(xe)) {
 		int save_err = err;
 
 		/*
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index d73cdad0b3a9..b50128cf4b18 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -364,11 +364,6 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev)
 	if (ret)
 		goto failed;
 
-	if (check_boot_failure(xe))
-		xe_log_err_fatal(pdev, SURVIVABILITY, 0, "Boot Mode enabled!\n");
-	else
-		xe_log_info(pdev, SURVIVABILITY, "Boot Mode enabled!\n");
-
 	return 0;
 
 failed:
@@ -390,17 +385,7 @@ bool xe_survivability_mode_is_boot_enabled(struct xe_device *xe)
 	return survivability->mode && survivability->type == XE_SURVIVABILITY_TYPE_BOOT;
 }
 
-/**
- * xe_survivability_mode_is_requested - check if it's possible to enable survivability
- *					mode that was requested by firmware or userspace
- * @xe: xe device instance
- *
- * This function reads configfs and  boot status from Pcode.
- *
- * Return: true if platform support is available and boot status indicates
- * failure or if survivability mode is requested, false otherwise.
- */
-bool xe_survivability_mode_is_requested(struct xe_device *xe)
+bool survivability_mode_required(struct xe_device *xe, bool log_on_action)
 {
 	struct xe_survivability *survivability = &xe->survivability;
 	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
@@ -413,13 +398,36 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
 
 	survivability_mode = xe_configfs_get_survivability_mode(pdev);
 	/* Enable survivability mode if set via configfs */
-	if (survivability_mode)
+	if (survivability_mode) {
+		if (log_on_action)
+			xe_log_info(xe, SURVIVABILITY, "Boot mode requested.\n");
 		return true;
+	}
 
 	data = xe_mmio_read32(mmio, PCODE_SCRATCH(0));
 	survivability->boot_status = REG_FIELD_GET(BOOT_STATUS, data);
 
-	return check_boot_failure(xe);
+	if (check_boot_failure(xe)) {
+		if (log_on_action)
+			xe_log_err_fatal(pdev, SURVIVABILITY, 0, "Boot Mode required!\n");
+		return true;
+	}
+	return false;
+}
+
+/**
+ * xe_survivability_mode_is_required - check if survivability mode is required based on
+ *                                     state of firmware or userspace request.
+ * @xe: xe device instance
+ *
+ * This function reads configfs and boot status from Pcode.
+ *
+ * Return: true if platform support is available and boot status indicates
+ * failure or if survivability mode is requested, false otherwise.
+ */
+bool xe_survivability_mode_is_required(struct xe_device *xe)
+{
+	return survivability_mode_required(xe, true);
 }
 
 /**
@@ -468,7 +476,7 @@ int xe_survivability_mode_boot_enable(struct xe_device *xe)
 	struct xe_survivability *survivability = &xe->survivability;
 	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
 
-	if (!xe_survivability_mode_is_requested(xe))
+	if (!survivability_mode_required(xe, false))
 		return 0;
 
 	populate_survivability_info(xe);
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.h b/drivers/gpu/drm/xe/xe_survivability_mode.h
index cd040e4d18bb..a68f071a8055 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.h
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.h
@@ -13,6 +13,6 @@ struct xe_device;
 int xe_survivability_mode_boot_enable(struct xe_device *xe);
 void xe_survivability_mode_runtime_enable(struct xe_device *xe);
 bool xe_survivability_mode_is_boot_enabled(struct xe_device *xe);
-bool xe_survivability_mode_is_requested(struct xe_device *xe);
+bool xe_survivability_mode_is_required(struct xe_device *xe);
 
 #endif /* _XE_SURVIVABILITY_MODE_H_ */

base-commit: 2cd78713d917a02987f21b437561a5e1e13ddda2
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability
@ 2026-10-30 17:17 Alan Previn
  2026-10-30 17:24 ` sashiko-bot
  2026-11-02  5:51 ` Tauro, Riana
  0 siblings, 2 replies; 19+ messages in thread
From: Alan Previn @ 2026-10-30 17:17 UTC (permalink / raw)
  To: intel-xe; +Cc: Alan Previn, dri-devel, Matt Roper, Raag Jadav, Riana Tauro

When user requests to enter survivabilty via configfs, or if
check_boot_failure is hit inside xe_survivability_mode_is_requested,
no indication is published. This patch adds some awareness in dmesg.

 v3 : Limit message to xe_survivability_mode_is_requested. (Riana)
 v2 : Remove / modify messages to reflect underlying behavior. (Sashiko)

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 drivers/gpu/drm/xe/xe_survivability_mode.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index d73cdad0b3a9..344b402eb728 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -413,13 +413,19 @@ bool xe_survivability_mode_is_requested(struct xe_device *xe)
 
 	survivability_mode = xe_configfs_get_survivability_mode(pdev);
 	/* Enable survivability mode if set via configfs */
-	if (survivability_mode)
+	if (survivability_mode) {
+		xe_log_info(xe, SURVIVABILITY, "Boot mode requested.");
 		return true;
+	}
 
 	data = xe_mmio_read32(mmio, PCODE_SCRATCH(0));
 	survivability->boot_status = REG_FIELD_GET(BOOT_STATUS, data);
 
-	return check_boot_failure(xe);
+	if (check_boot_failure(xe)) {
+		xe_log_err_fatal(pdev, SURVIVABILITY, 0, "Boot Mode enabled!\n");
+		return true;
+	}
+	return false;
 }
 
 /**

base-commit: d8a353e238652bec29fd452babdaae0044d30b9b
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability
@ 2026-10-23 17:36 Alan Previn
  2026-10-28  3:18 ` Raag Jadav
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Previn @ 2026-10-23 17:36 UTC (permalink / raw)
  To: intel-xe; +Cc: Alan Previn, dri-devel, Matt Roper, Riana Tauro

Today, when the driver faces issues with early pcode errors
and attempts to enter survivabilty (when explicitly requested)
it may either succeed or fail (latter being possible due to
underlying subsystem blockers). During this flow the driver remains
loaded and completely silent. No messages indicate that it may need
or it attempted and succeeded or it attempted and failed, to enter
survivability mode. This patch adds some awareness in dmesg.

 v2 : Remove / modify messages to reflect underlying behavior. (Sashiko)

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 35 ++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index a07655b4c7a9..23ee6f255205 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -710,7 +710,8 @@ static int xe_device_vram_alloc(struct xe_device *xe)
  */
 int xe_device_probe_early(struct xe_device *xe)
 {
-	int err;
+	int err, pcode_err;
+	bool survival_requested;
 
 	xe_wa_device_init(xe);
 	xe_wa_process_device_oob(xe);
@@ -734,20 +735,34 @@ int xe_device_probe_early(struct xe_device *xe)
 	 * initialization is complete. Until done, any MMIO or lmem access from
 	 * the driver will be blocked
 	 */
-	err = xe_pcode_probe_early(xe);
-	if (err || xe_survivability_mode_is_requested(xe)) {
-		int save_err = err;
-
+	pcode_err = xe_pcode_probe_early(xe);
+	survival_requested = xe_survivability_mode_is_requested(xe);
+	if (pcode_err || survival_requested) {
 		/*
 		 * Try to leave device in survivability mode if device is
 		 * possible, but still return the previous error for error
 		 * propagation
 		 */
-		err = xe_survivability_mode_boot_enable(xe);
-		if (err)
-			return err;
-
-		return save_err;
+		int survive_err = xe_survivability_mode_boot_enable(xe);
+
+		if (survive_err) {
+			if (pcode_err && survival_requested)
+				xe_err(xe, "Early pcode err(%pe), survivability requested but unavailable(%pe)\n",
+				       ERR_PTR(pcode_err), ERR_PTR(survive_err));
+			else if (!pcode_err)
+				xe_warn(xe, "Early pcode ok, survivability requested but unavailable(%pe)\n",
+					ERR_PTR(survive_err));
+			return survive_err;
+		}
+		if (pcode_err && survival_requested)
+			xe_notice(xe, "Early pcode err(%pe), survivability requested\n",
+				  ERR_PTR(pcode_err));
+		else if (!pcode_err)
+			xe_notice(xe, "Early pcode ok but survivability requested\n");
+		else
+			xe_warn(xe, "Early pcode err(%pe) but survivability not requested or unsupported\n",
+				ERR_PTR(pcode_err));
+		return pcode_err;
 	}
 
 	/*

base-commit: b255dd13059988fddde9ea187d1dd1017c9a5766
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread
* [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability
@ 2026-10-23  0:18 Alan Previn
  2026-10-23  0:27 ` sashiko-bot
  0 siblings, 1 reply; 19+ messages in thread
From: Alan Previn @ 2026-10-23  0:18 UTC (permalink / raw)
  To: intel-xe; +Cc: Alan Previn, dri-devel, Matt Roper, Riana Tauro

Today, when the driver faces issues with early pcode errors
and attempts to enter survivabilty (when explicitly requested)
it may either succeed or fail (latter being possible due to
underlying subsystem blockers). During this flow the driver remains
loaded and completely silent. No messages indicate that it may need
or it attempted and succeeded or it attempted and failed, to enter
survivability mode. This patch adds some awareness in dmesg.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 38 +++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index a07655b4c7a9..45ff28ed41a4 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -710,7 +710,8 @@ static int xe_device_vram_alloc(struct xe_device *xe)
  */
 int xe_device_probe_early(struct xe_device *xe)
 {
-	int err;
+	int err, pcode_err;
+	bool survival_requested;
 
 	xe_wa_device_init(xe);
 	xe_wa_process_device_oob(xe);
@@ -734,20 +735,37 @@ int xe_device_probe_early(struct xe_device *xe)
 	 * initialization is complete. Until done, any MMIO or lmem access from
 	 * the driver will be blocked
 	 */
-	err = xe_pcode_probe_early(xe);
-	if (err || xe_survivability_mode_is_requested(xe)) {
-		int save_err = err;
-
+	pcode_err = xe_pcode_probe_early(xe);
+	survival_requested = xe_survivability_mode_is_requested(xe);
+	if (pcode_err || survival_requested) {
 		/*
 		 * Try to leave device in survivability mode if device is
 		 * possible, but still return the previous error for error
 		 * propagation
 		 */
-		err = xe_survivability_mode_boot_enable(xe);
-		if (err)
-			return err;
-
-		return save_err;
+		int survive_err = xe_survivability_mode_boot_enable(xe);
+
+		if (survive_err) {
+			if (pcode_err && survival_requested)
+				xe_err(xe, "Early pcode err(%pe), survivability requested but unavailable(%pe)\n",
+				       ERR_PTR(pcode_err), ERR_PTR(survive_err));
+			else if (!pcode_err)
+				xe_warn(xe, "Early pcode ok, survivability requested but unavailable(%pe)\n",
+					ERR_PTR(survive_err));
+			else
+				xe_warn(xe, "Early pcode err(%pe), survivability not requested and unavailable(%pe)\n",
+					ERR_PTR(pcode_err), ERR_PTR(survive_err));
+			return survive_err;
+		}
+		if (pcode_err && survival_requested)
+			xe_notice(xe, "Early pcode err(%pe), survivability requested\n",
+				  ERR_PTR(pcode_err));
+		else if (!pcode_err)
+			xe_notice(xe, "Early pcode ok but survivability requested\n");
+		else
+			xe_warn(xe, "Early pcode err(%pe), survivability not requested. Consider xe_configfs\n",
+				ERR_PTR(pcode_err));
+		return pcode_err;
 	}
 
 	/*

base-commit: 55c6bb0b4d006ee415abe9f048014f7bcc90ae6f
-- 
2.43.0


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

end of thread, other threads:[~2026-11-03  6:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 22:26 [PATCH 1/1] drm/xe/survivability: broadcast dmesg when engaging survivability Alan Previn
2026-11-02 22:33 ` sashiko-bot
2026-11-03  6:29 ` Tauro, Riana
  -- strict thread matches above, loose matches on Subject: below --
2026-11-02 22:19 Alan Previn
2026-11-02 22:27 ` sashiko-bot
2026-10-30 17:17 Alan Previn
2026-10-30 17:24 ` sashiko-bot
2026-11-02  5:51 ` Tauro, Riana
2026-11-02 19:33   ` Teres Alexis, Alan Previn
2026-10-23 17:36 Alan Previn
2026-10-28  3:18 ` Raag Jadav
2026-10-28 21:01   ` Teres Alexis, Alan Previn
2026-10-29  4:48     ` Raag Jadav
2026-10-29  9:38       ` Tauro, Riana
2026-10-29 18:41         ` Teres Alexis, Alan Previn
2026-10-29 18:57           ` Teres Alexis, Alan Previn
2026-10-23  0:18 Alan Previn
2026-10-23  0:27 ` sashiko-bot
2026-10-23 16:43   ` Teres Alexis, Alan Previn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox