Re: [PATCH v2] drm/xe/pci_error: Allow debugging PCI errors

[email protected]
Newsgroups org.freedesktop.lists.intel-xe
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unconditional device wedging and disconnection on recoverable non-fatal AER errors when debugging mode is enabled.
--

--- Patch [1]: [PATCH v2] drm/xe/pci_error: Allow debugging PCI errors ---
commit 26ac63dc9350283e2a915daf342c236caf34f680
Author: Raag Jadav <[email protected]>

drm/xe/pci_error: Allow debugging PCI errors

This commit updates the PCI error handling path to disconnect the device
and prevent a bus reset when the XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET
debug mode is enabled. This preserves the device state so it is available
to the user for debugging.

> diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
> index e41af2ac7f23b..98aa26275ad66 100644
> --- a/drivers/gpu/drm/xe/xe_pci_error.c
> +++ b/drivers/gpu/drm/xe/xe_pci_error.c
> @@ -83,6 +83,12 @@ static pci_ers_result_t xe_pci_error_mmio_enabled(struct pci_dev *pdev)
>  	xe_info(xe, "PCI error: MMIO enabled\n");
>  	action = xe_ras_process_errors(xe);
>  
> +	/* User wants to debug the error, prevent reset */
> +	if (xe->wedged.mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> +		xe_device_declare_wedged(xe);
> +		return PCI_ERS_RESULT_DISCONNECT;
> +	}

[Severity: Medium]
Does this code unnecessarily wedge the device on recoverable errors? 

When XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET is enabled, any non-fatal AER 
that reaches xe_pci_error_mmio_enabled() will unconditionally wedge the 
device here. This happens even if xe_ras_process_errors(xe) successfully 
handles the error and returns XE_RAS_RECOVERY_ACTION_RECOVERED in the 
action variable.

Since the commit message specifically mentions preventing bus resets for 
debugging, should this disconnect and wedge logic only be triggered if 
action == XE_RAS_RECOVERY_ACTION_RESET?

> +
>  	return ras_action_to_pci_result(pdev, action);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.