Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Wedge device if page offline list is full
@ 2026-11-26 12:43 Soham Purkait
  2026-11-26 12:43 ` [PATCH v2 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining Soham Purkait
  2026-11-26 12:43 ` [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe Soham Purkait
  0 siblings, 2 replies; 4+ messages in thread
From: Soham Purkait @ 2026-11-26 12:43 UTC (permalink / raw)
  To: intel-xe, riana.tauro, anshuman.gupta, aravind.iddamsetty,
	badal.nilawar, raag.jadav, rodrigo.vivi
  Cc: soham.purkait

When the firmware's page offline list is full, no more pages can be
offlined. Wedge the device with an unknown recovery method in this
case, at probe and at runtime.

v1:
 - Refactor subject lines. (Riana)
 - Split the patch. (Riana)

Soham Purkait (2):
  drm/xe/ras: Wedge device if page offline list is full during offlining
  drm/xe/ras: Wedge device if page offline list is full at probe

 drivers/gpu/drm/xe/xe_ras.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

-- 
2.43.0


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

* [PATCH v2 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining
  2026-11-26 12:43 [PATCH v2 0/2] Wedge device if page offline list is full Soham Purkait
@ 2026-11-26 12:43 ` Soham Purkait
  2026-11-26 12:43 ` [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe Soham Purkait
  1 sibling, 0 replies; 4+ messages in thread
From: Soham Purkait @ 2026-11-26 12:43 UTC (permalink / raw)
  To: intel-xe, riana.tauro, anshuman.gupta, aravind.iddamsetty,
	badal.nilawar, raag.jadav, rodrigo.vivi
  Cc: soham.purkait

When a page offline request is sent to the firmware, it response with
OUT_OF_RESOURCES if its offline list in flash is full and cannot hold
any more pages.

Wedge the device with an unknown recovery method in this case, as
manual intervention is required.

Signed-off-by: Soham Purkait <soham.purkait@intel.com>
---
v1:
 - Add consistent dmesg. (Riana)
---
 drivers/gpu/drm/xe/xe_ras.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 0fb891d00b36..754514412694 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -80,6 +80,7 @@ enum xe_ras_response_status {
 	XE_RAS_STATUS_TIMEOUT,
 	XE_RAS_STATUS_HARDWARE_FAILURE,
 	XE_RAS_STATUS_INSUFFICIENT_RESOURCES,
+	XE_RAS_STATUS_OUT_OF_RESOURCES = 0x9,
 	XE_RAS_STATUS_MAX
 };
 
@@ -226,6 +227,7 @@ static int ras_status_to_errno(u32 status)
 	case XE_RAS_STATUS_HARDWARE_FAILURE:
 		return -EIO;
 	case XE_RAS_STATUS_INSUFFICIENT_RESOURCES:
+	case XE_RAS_STATUS_OUT_OF_RESOURCES:
 		return -ENOSPC;
 	default:
 		return -EPROTO;
@@ -299,6 +301,10 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
 	if (ret) {
 		xe_log_err(xe, SYSCTRL, ret, "page offline command failed with status %u\n",
 			   response.status);
+		if (response.status == XE_RAS_STATUS_OUT_OF_RESOURCES) {
+			xe_err(xe, "[RAS]: page offline list is full\n");
+			xe_wedge_declare(xe, 0);
+		}
 		return ret;
 	}
 
-- 
2.43.0


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

* [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe
  2026-11-26 12:43 [PATCH v2 0/2] Wedge device if page offline list is full Soham Purkait
  2026-11-26 12:43 ` [PATCH v2 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining Soham Purkait
@ 2026-11-26 12:43 ` Soham Purkait
  2026-11-26 13:04   ` sashiko-bot
  1 sibling, 1 reply; 4+ messages in thread
From: Soham Purkait @ 2026-11-26 12:43 UTC (permalink / raw)
  To: intel-xe, riana.tauro, anshuman.gupta, aravind.iddamsetty,
	badal.nilawar, raag.jadav, rodrigo.vivi
  Cc: soham.purkait

During probe, the driver reads the permanently offlined pages from the
firmware's offline list. If the list has reached its maximum number of
entries, the firmware cannot offline any more pages, so further memory
errors cannot be contained by page offlining.

Wedge the device with an unknown recovery method and fail probe in
this case, as manual intervention is required.

Signed-off-by: Soham Purkait <soham.purkait@intel.com>
---
v1:
 - Add consistent dmesg. (Riana)
 - Get total pages before post processing. (Riana)

v2:
 - Fail probe. (Badal)
---
 drivers/gpu/drm/xe/xe_ras.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 754514412694..ad62d5acc1a6 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -487,6 +487,11 @@ static void process_offline_pages(struct xe_device *xe, u32 cmd, void *req, size
 			return;
 		}
 	} while (common->additional_data);
+
+	if (!xe_wedged(xe) && list_req && state->max_pages && total_pages >= state->max_pages) {
+		xe_err(xe, "[RAS]: page offline list is full\n");
+		xe_wedge_declare(xe, 0);
+	}
 }
 
 /*
@@ -1360,6 +1365,9 @@ int xe_ras_init(struct xe_device *xe)
 	ret = devm_device_add_group(xe->drm.dev, &gpu_health_group);
 	if (ret)
 		return ret;
+
+	if (xe_wedged(xe))
+		return -ECANCELED;
 
 	return xe_cper_sysfs_init(xe);
 }
-- 
2.43.0


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

* Re: [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe
  2026-11-26 12:43 ` [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe Soham Purkait
@ 2026-11-26 13:04   ` sashiko-bot
  0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-26 13:04 UTC (permalink / raw)
  To: Soham Purkait, intel-xe

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] drm/xe/ras: failing xe_ras_init() when wedged breaks uevent and
  survivability
- [High] drm/xe/ras: xe_ras_init() drains firmware queues after
  get_offline_list() wedges
- [Medium] drm/xe/ras: process_offline_pages() wedges when page
  offlining is disabled
--

commit 5b8e982f9fdf2b8f109d3d2ea5883f110981be63
Author: Soham Purkait <soham.purkait@intel.com>

drm/xe/ras: Wedge device if page offline list is full at probe

This commit declares the device wedged in process_offline_pages() when the
firmware page offline list has reached its maximum capacity, and fails
xe_ras_init() with -ECANCELED if the device is wedged.

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 7545144126941..1bb4d53db3d88 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -487,6 +487,11 @@ static void process_offline_pages(struct xe_device *xe, u32 cmd, void *req, size
>  			return;
>  		}
>  	} while (common->additional_data);
> +
> +	if (!xe_wedged(xe) && list_req && state->max_pages && total_pages >= state->max_pages) {
> +		xe_err(xe, "[RAS]: page offline list is full\n");
> +		xe_wedge_declare(xe, 0);
> +	}
>  }
>  
>  /*

[Severity: Medium]
Should this check skip wedging when xe_ras_get_disable_vram_page_offline(xe)
is true?

When disable_vram_page_offline is enabled in configfs, handle_page_offline()
bypasses page offlining and sends XE_RAS_PAGE_ACTION_REMOVE instead of
offlining additional pages in firmware.  Wedging here still fails probe on a
device whose firmware offline list is already full, even though page
offlining has been disabled by user policy.

> @@ -1361,5 +1366,8 @@ int xe_ras_init(struct xe_device *xe)
>  	if (ret)
>  		return ret;
>  
> +	if (xe_wedged(xe))
> +		return -ECANCELED;
> +
>  	return xe_cper_sysfs_init(xe);
>  }

[Severity: High]
Does returning -ECANCELED from xe_ras_init() when xe_wedged(xe) is true
break runtime survivability mode and the wedged uevent?

xe_ras_init() runs in xe_device_probe() before drm_dev_register().  Because
this check is placed after xe_ras_process_errors(), any error handler that
wedges the device during probe now aborts probe and triggers devres teardown:

drivers/gpu/drm/xe/xe_ras.c:handle_soc_internal_errors() {
    ...
		if (csc_error->hec_fw_error) {
			xe_log_comp_fatal(xe, SOC_INTERNAL, &arr->counter, sizeof(arr->counter),
					  "CSC error detected: 0x%08x\n", csc_error->hec_fw_error);
			xe_survivability_mode_runtime_enable(xe);
			return XE_RAS_RECOVERY_ACTION_DISCONNECT;
		}
    ...
}

Unlike boot survivability, __xe_pci_probe() does not intercept probe failure
for runtime survivability, so returning -ECANCELED immediately removes the
survivability sysfs files via xe_survivability_mode_fini() and runs a
Driver-FLR via xe_driver_flr_fini().  In addition, xe->wedged.work scheduled
by xe_wedge_declare() either gets canceled by disable_work_sync() in
xe_wedge_fini() before notifying userspace, or runs drm_dev_wedged_event()
on an unregistered drm_minor kdev before device_add().

[Severity: High]
When get_offline_list() wedges the device in xe_ras_init(), does continuing
through get_offline_queue() and xe_ras_process_errors() before checking
xe_wedged(xe) lose pending poison pages and error records?

In xe_ras_init(), get_offline_queue() soft-offlines queued pages in the
driver's volatile TTM VRAM manager and sends XE_RAS_PAGE_ACTION_REMOVE to
remove first-occurrence poison pages from the firmware's SRAM queue, and
xe_ras_process_errors() drains pending SoC error records via
XE_SYSCTRL_CMD_GET_SOC_ERROR.  Returning -ECANCELED afterward tears down the
TTM VRAM manager's soft-offlined page reservations after those entries have
already been consumed from firmware.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126124310.2187015-4-soham.purkait@intel.com?part=2

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

end of thread, other threads:[~2026-11-26 13:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 12:43 [PATCH v2 0/2] Wedge device if page offline list is full Soham Purkait
2026-11-26 12:43 ` [PATCH v2 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining Soham Purkait
2026-11-26 12:43 ` [PATCH v2 2/2] drm/xe/ras: Wedge device if page offline list is full at probe Soham Purkait
2026-11-26 13:04   ` sashiko-bot

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