Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI/AER: Pass service type to pcie_do_fatal_recovery()

Pass the service type to pcie_do_fatal_recovery() instead of assuming AER.
We will make DPC also use pcie_do_fatal_recovery(), and it needs to do
things a little differently for AER and DPC.

Signed-off-by: Oza Pawandeep <poza@codeaurora.org>
[bhelgaas: split to separate patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Oza Pawandeep and committed by
Bjorn Helgaas
0b91439d 6927868e

+9 -8
+1 -1
drivers/pci/pci.h
··· 354 354 void pci_enable_acs(struct pci_dev *dev); 355 355 356 356 /* PCI error reporting and recovery */ 357 - void pcie_do_fatal_recovery(struct pci_dev *dev); 357 + void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service); 358 358 void pcie_do_nonfatal_recovery(struct pci_dev *dev); 359 359 360 360 bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
+2 -2
drivers/pci/pcie/aer/aerdrv_core.c
··· 254 254 } else if (info->severity == AER_NONFATAL) 255 255 pcie_do_nonfatal_recovery(dev); 256 256 else if (info->severity == AER_FATAL) 257 - pcie_do_fatal_recovery(dev); 257 + pcie_do_fatal_recovery(dev, PCIE_PORT_SERVICE_AER); 258 258 } 259 259 260 260 #ifdef CONFIG_ACPI_APEI_PCIEAER ··· 321 321 if (entry.severity == AER_NONFATAL) 322 322 pcie_do_nonfatal_recovery(pdev); 323 323 else if (entry.severity == AER_FATAL) 324 - pcie_do_fatal_recovery(pdev); 324 + pcie_do_fatal_recovery(pdev, PCIE_PORT_SERVICE_AER); 325 325 pci_dev_put(pdev); 326 326 } 327 327 }
+6 -5
drivers/pci/pcie/err.c
··· 180 180 return PCI_ERS_RESULT_RECOVERED; 181 181 } 182 182 183 - static pci_ers_result_t reset_link(struct pci_dev *dev) 183 + static pci_ers_result_t reset_link(struct pci_dev *dev, u32 service) 184 184 { 185 185 struct pci_dev *udev; 186 186 pci_ers_result_t status; ··· 195 195 } 196 196 197 197 /* Use the aer driver of the component firstly */ 198 - driver = pcie_port_find_service(udev, PCIE_PORT_SERVICE_AER); 198 + driver = pcie_port_find_service(udev, service); 199 199 200 200 if (driver && driver->reset_link) { 201 201 status = driver->reset_link(udev); ··· 281 281 * beneath this AER agent, followed by reset link e.g. secondary bus reset 282 282 * followed by re-enumeration of devices. 283 283 */ 284 - void pcie_do_fatal_recovery(struct pci_dev *dev) 284 + void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) 285 285 { 286 286 struct pci_dev *udev; 287 287 struct pci_bus *parent; ··· 306 306 pci_dev_put(pdev); 307 307 } 308 308 309 - result = reset_link(udev); 309 + result = reset_link(udev, service); 310 310 311 - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 311 + if ((service == PCIE_PORT_SERVICE_AER) && 312 + (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) { 312 313 /* 313 314 * If the error is reported by a bridge, we think this error 314 315 * is related to the downstream link of the bridge, so we