public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: <anshuman.gupta@intel.com>, <rodrigo.vivi@intel.com>,
	<aravind.iddamsetty@linux.intel.com>, <badal.nilawar@intel.com>,
	<raag.jadav@intel.com>, <ravi.kishore.koppuravuri@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 10/11] drm/xe/xe_ras: Handle Uncorrectable SoC Internal errors
Date: Tue, 10 Mar 2026 18:59:38 +0530	[thread overview]
Message-ID: <4d62f154-dd1f-4213-a5ff-87abf09c4ab9@intel.com> (raw)
In-Reply-To: <20260302102155.4074630-23-riana.tauro@intel.com>


On 02-03-2026 03:52 pm, Riana Tauro wrote:
> Some critical errors such as CSC firmware and Punit are reported under
> SoC Internal Errors.
>
> CSC errors are classified as hardware errors and firmware errors.
> Hardware errors can be recovered using a SBR whereas firmware errors
> are critical and require a firmware flash. On such errors, device will
> be wedged and runtime survivability mode will be enabed to notify
> userspace that a firmware flash is required.
>
> PUNIT uncorrectable errors can only be recovered through a cold reset.
> TODO: Wedge device and notify userspace that a cold reset is required.
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_ras.c | 52 +++++++++++++++++++++++++++++++++++++
>   1 file changed, 52 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 61c01a4bfadb..f35d77654c8f 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -7,6 +7,7 @@
>   #include "xe_printk.h"
>   #include "xe_ras.h"
>   #include "xe_ras_types.h"
> +#include "xe_survivability_mode.h"
>   #include "xe_sysctrl_mailbox.h"
>   #include "xe_sysctrl_mailbox_types.h"
>   
> @@ -102,6 +103,54 @@ static enum xe_ras_recovery_action handle_compute_errors(struct xe_device *xe,
>   	return XE_RAS_RECOVERY_ACTION_RECOVERED;
>   }
>   
> +static enum xe_ras_recovery_action handle_soc_internal_errors(struct xe_device *xe,
> +							      struct xe_ras_error_array *arr)
> +{
> +	struct xe_ras_soc_error *error_info = (struct xe_ras_soc_error *)arr->error_details;
> +	struct xe_ras_soc_error_source source = error_info->error_source;
> +	struct xe_ras_error_common common_info = arr->error_class.common;
> +	enum xe_ras_recovery_action action;
> +
> +	/* Default action */
> +	action = XE_RAS_RECOVERY_ACTION_RESET;
> +
> +	log_ras_error(xe, &arr->error_class);
> +
> +	if (source.csc) {
> +		struct xe_ras_csc_error *csc_error = (struct xe_ras_csc_error *)error_info->additional_details;
> +
> +		/*
> +		 * CSC uncorrectable errors are classified as hardware errors and firmware errors.
> +		 * CSC firmware errors are critical errors that can be recovered only by firmware
> +		 * update via SPI driver. PCODE enables FDO mode and sets the bit in the capability
> +		 * register. On receiving this error, the driver enables runtime survivability mode
> +		 * which notifies userspace that a firmware update is required.
> +		 */
> +		if (csc_error->hec_uncorr_fw_err_dw0) {
> +			xe_err(xe, "[RAS]: CSC %s error detected: 0x%x\n",
> +			       severity_to_str(xe, common_info.severity),
> +			       csc_error->hec_uncorr_fw_err_dw0);
> +			xe_survivability_mode_runtime_enable(xe);
> +			action = XE_RAS_RECOVERY_ACTION_DISCONNECT;
> +		}
> +	}
> +
> +	if (source.soc) {
> +		struct xe_ras_ieh_error *ieh_error = (struct xe_ras_ieh_error *)error_info->additional_details;
> +
> +		if (ieh_error->error_sources_ieh0.punit) {
> +			xe_err(xe, "[RAS]: PUNIT %s error detected: 0x%x\n",
> +			       severity_to_str(xe, common_info.severity),
> +			       ieh_error->error_sources_ieh0.punit);
> +			/** TODO: Add PUNIT error handling */
> +			action = XE_RAS_RECOVERY_ACTION_DISCONNECT;
> +		}
> +	}
> +

Use else if in source.soc, since source.csc and source.soc bits are set 
(even it's not happen), the same additional details are

cast two different structure type may cause undefined behavior.

Thanks

-/Mallesh

> +	/* For other SOC internal errors, request a reset as recovery mechanism */
> +	return action;
> +}
> +
>   static void xe_ras_prepare_sysctrl_command(struct xe_sysctrl_mailbox_command *command,
>   					   u32 cmd_mask, void *request, size_t request_len,
>   					   void *response, size_t response_len)
> @@ -180,6 +229,9 @@ enum xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe)
>   			case XE_RAS_COMPONENT_CORE_COMPUTE:
>   				action = handle_compute_errors(xe, &arr);
>   				break;
> +			case XE_RAS_COMPONENT_SOC_INTERNAL:
> +				action = handle_soc_internal_errors(xe, &arr);
> +				break;
>   			default:
>   				xe_err(xe, "[RAS]: Unknown error component %u\n", component);
>   				break;

  reply	other threads:[~2026-03-10 13:29 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 10:21 [PATCH v2 00/11] Introduce Xe Uncorrectable Error Handling Riana Tauro
2026-03-02 10:21 ` [PATCH v2 01/11] drm/xe/xe_sysctrl: Add System controller patch Riana Tauro
2026-03-02 10:21 ` [PATCH v2 02/11] drm/xe/xe_survivability: Decouple survivability info from boot survivability Riana Tauro
2026-03-02 17:00   ` Raag Jadav
2026-03-03  8:18     ` Mallesh, Koujalagi
2026-03-30 12:56       ` Tauro, Riana
2026-03-30 13:00     ` Tauro, Riana
2026-03-02 10:21 ` [PATCH v2 03/11] drm/xe/xe_pci_error: Implement PCI error recovery callbacks Riana Tauro
2026-03-02 17:37   ` Raag Jadav
2026-03-03  5:09     ` Riana Tauro
2026-03-04 10:38   ` Mallesh, Koujalagi
2026-03-31  5:18     ` Tauro, Riana
2026-03-02 10:21 ` [PATCH v2 04/11] drm/xe/xe_pci_error: Group all devres to release them on PCIe slot reset Riana Tauro
2026-03-02 10:22 ` [PATCH v2 05/11] drm/xe: Skip device access during PCI error recovery Riana Tauro
2026-03-04 10:59   ` Mallesh, Koujalagi
2026-03-02 10:22 ` [PATCH v2 06/11] drm/xe/xe_ras: Initialize Uncorrectable AER Registers Riana Tauro
2026-03-02 10:22 ` [PATCH v2 07/11] drm/xe/xe_ras: Add structures and commands for Uncorrectable Core Compute Errors Riana Tauro
2026-03-04 16:32   ` Raag Jadav
2026-03-31 16:14     ` Tauro, Riana
2026-04-01  6:25       ` Raag Jadav
2026-04-01  6:39         ` Tauro, Riana
2026-03-02 10:22 ` [PATCH v2 08/11] drm/xe/xe_ras: Add support for Uncorrectable Core-Compute errors Riana Tauro
2026-03-04 16:52   ` Raag Jadav
2026-03-06 18:37     ` Raag Jadav
2026-03-31 16:24     ` Tauro, Riana
2026-04-01  6:34       ` Raag Jadav
2026-04-01  6:47         ` Tauro, Riana
2026-03-06  3:50   ` [v2,08/11] " Purkait, Soham
2026-03-31 16:16     ` Tauro, Riana
2026-03-02 10:22 ` [PATCH v2 09/11] drm/xe/xe_ras: Add structures for SoC Internal errors Riana Tauro
2026-03-10 13:02   ` Mallesh, Koujalagi
2026-03-11 14:51     ` Riana Tauro
2026-03-02 10:22 ` [PATCH v2 10/11] drm/xe/xe_ras: Handle Uncorrectable " Riana Tauro
2026-03-10 13:29   ` Mallesh, Koujalagi [this message]
2026-03-11 14:55     ` Riana Tauro
2026-03-02 10:22 ` [PATCH v2 11/11] drm/xe/xe_pci_error: Process errors in mmio_enabled Riana Tauro
2026-03-11  7:10   ` Mallesh, Koujalagi
2026-03-11 14:39     ` Riana Tauro
2026-03-12  8:08       ` Mallesh, Koujalagi
2026-03-02 16:10 ` ✗ CI.checkpatch: warning for Introduce Xe Uncorrectable Error Handling (rev2) Patchwork
2026-03-02 16:11 ` ✓ CI.KUnit: success " Patchwork
2026-03-02 16:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-02 18:29 ` ✗ 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=4d62f154-dd1f-4213-a5ff-87abf09c4ab9@intel.com \
    --to=mallesh.koujalagi@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=raag.jadav@intel.com \
    --cc=ravi.kishore.koppuravuri@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@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