RE: [PATCH v4 13/13] drm/xe/xe_pci_error: Process errors in mmio_enabled

Gupta, Anshuman
2026-04-30T11:15:11Z

> -----Original Message-----
> From: Tauro, Riana <riana.tauro@intel.com>
> Sent: Friday, April 17, 2026 2:28 PM
> To: intel-xe@lists.freedesktop.org
> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman
> <anshuman.gupta@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>;
> aravind.iddamsetty@linux.intel.com; Nilawar, Badal
> <badal.nilawar@intel.com>; Jadav, Raag <raag.jadav@intel.com>;
> Koppuravuri, Ravi Kishore <ravi.kishore.koppuravuri@intel.com>; Koujalagi,
> Mallesh <mallesh.koujalagi@intel.com>; Purkait, Soham
> <soham.purkait@intel.com>
> Subject: [PATCH v4 13/13] drm/xe/xe_pci_error: Process errors in
> mmio_enabled
>
> Query system controller when any non fatal error occurs to check the type of
> the error, contain and recover.
>
> The system controller is queried in the mmio_enabled callback.
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
> v2: use ras recovery enum (Raag)
>
> v3: add comment for mapping
> use const (Mallesh)
> ---
> drivers/gpu/drm/xe/xe_pci_error.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci_error.c
> b/drivers/gpu/drm/xe/xe_pci_error.c
> index 7d80bc2a6954..b7acf6778603 100644
> --- a/drivers/gpu/drm/xe/xe_pci_error.c
> +++ b/drivers/gpu/drm/xe/xe_pci_error.c
> @@ -9,6 +9,7 @@
> #include "xe_device.h"
> #include "xe_gt.h"
> #include "xe_pci.h"
> +#include "xe_ras.h"
> #include "xe_survivability_mode.h"
> #include "xe_uc.h"
>
> @@ -34,6 +35,13 @@ static void xe_pci_error_handling(struct pci_dev
> *pdev)
> pci_disable_device(pdev);
> }
>
> +/* Mapping of RAS recovery action to PCI error result */ static const
> +pci_ers_result_t ras_recovery_action_to_pci_result[] = {
> + [XE_RAS_RECOVERY_ACTION_RECOVERED] =
> PCI_ERS_RESULT_RECOVERED,
> + [XE_RAS_RECOVERY_ACTION_RESET] =
> PCI_ERS_RESULT_NEED_RESET,
> + [XE_RAS_RECOVERY_ACTION_DISCONNECT] =
> PCI_ERS_RESULT_DISCONNECT, };
> +
> static pci_ers_result_t xe_pci_error_detected(struct pci_dev *pdev,
> pci_channel_state_t state) {
> struct xe_device *xe = pdev_to_xe_device(pdev); @@ -59,9 +67,13
> @@ static pci_ers_result_t xe_pci_error_detected(struct pci_dev *pdev,
> pci_channel_
>
> static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev) {
> + struct xe_device *xe = pdev_to_xe_device(pdev);
> + enum xe_ras_recovery_action action;
> +
> dev_err(&pdev->dev, "Xe Pci error recovery: MMIO enabled\n");
> + action = xe_ras_process_errors(xe);
>
> - return PCI_ERS_RESULT_NEED_RESET;
> + return ras_recovery_action_to_pci_result[action];
Don't we need the array bound check for action ?
Above review comment assisted by AI Tools.
Thanks,
Anshuman
> }
>
> static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
> --
> 2.47.1