mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
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. Reviewed-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260713074755.1278607-10-riana.tauro@intel.com Signed-off-by: Riana Tauro <riana.tauro@intel.com>
This commit is contained in:
parent
d9732e498f
commit
acc744fa62
|
|
@ -10,6 +10,7 @@
|
|||
#include "xe_pci.h"
|
||||
#include "xe_pm.h"
|
||||
#include "xe_printk.h"
|
||||
#include "xe_ras.h"
|
||||
#include "xe_survivability_mode.h"
|
||||
|
||||
static void prepare_device_for_reset(struct pci_dev *pdev)
|
||||
|
|
@ -34,6 +35,21 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
|
|||
pci_disable_device(pdev);
|
||||
}
|
||||
|
||||
static pci_ers_result_t ras_action_to_pci_result(struct pci_dev *pdev, u8 action)
|
||||
{
|
||||
switch (action) {
|
||||
case XE_RAS_RECOVERY_ACTION_RECOVERED:
|
||||
return PCI_ERS_RESULT_RECOVERED;
|
||||
case XE_RAS_RECOVERY_ACTION_RESET:
|
||||
prepare_device_for_reset(pdev);
|
||||
return PCI_ERS_RESULT_NEED_RESET;
|
||||
case XE_RAS_RECOVERY_ACTION_DISCONNECT:
|
||||
return PCI_ERS_RESULT_DISCONNECT;
|
||||
default:
|
||||
return 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);
|
||||
|
|
@ -62,11 +78,12 @@ 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;
|
||||
|
||||
xe_info(xe, "PCI error: MMIO enabled\n");
|
||||
action = xe_ras_process_errors(xe);
|
||||
|
||||
/* TODO: Query system controller for the type of error and take appropriate action */
|
||||
return PCI_ERS_RESULT_RECOVERED;
|
||||
return ras_action_to_pci_result(pdev, action);
|
||||
}
|
||||
|
||||
static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user