On Mon, Mar 04, 2024 at 04:08:19AM -0500, Ethan Zhao wrote:You know, to disclose the detail hardware and BIOS info list might invovle
Per PCI firmware spec r3.3 sec 4.6.12, for firmware first mode DPCPlease provide more detailed information about the hardware and BIOS
handling path, FW should clear UC errors logged by port and bring link
out of DPC, but because of ambiguity of wording in the spec, some BIOSes
doesn't clear the surprise down error and the error bits in pci status,
still notify OS to handle it. thus following trick is needed in EDR when
double reporting (hot removal interrupt && dpc notification) is hit.
affected by this.
-static void dpc_handle_surprise_removal(struct pci_dev *pdev)This change of moving dpc_is_surprise_removal() into
+bool dpc_handle_surprise_removal(struct pci_dev *pdev)
{
+ if (!dpc_is_surprise_removal(pdev))
+ return false;
dpc_handle_surprise_removal() seems unrelated to the problem at hand.
Please drop it if it's unnecessary to fix the issue.
--- a/drivers/pci/pcie/edr.cThis seems to be the only necessary change. Please reduce the
+++ b/drivers/pci/pcie/edr.c
@@ -184,6 +184,9 @@ static void edr_handle_event(acpi_handle handle, u32 event, void *data)
goto send_ost;
}
+ if (dpc_handle_surprise_removal(edev))
+ goto send_ost;
+
dpc_process_error(edev);
pci_aer_raw_clear_status(edev);
patch to contain only it and no other refactoring.
Please capitalize the "PCI/EDR: " prefix in the subject and add
a Fixes tag.
Thanks,
Lukas