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

Raag Jadav
2026-05-02T17:55:56Z

On Thu, Apr 30, 2026 at 04:45:05PM +0530, Gupta, Anshuman wrote:
> > -----Original Message-----
> > From: Tauro, Riana <riana.tauro@intel.com>
> >
> > 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.

...

> > +/* 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.

We're not storing any meaningful data here, I'd rather use switch().

Raag