diff options
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 9f5ccbeb4fa5..f4512feac12b 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -35,6 +35,9 @@ int pci_enable_pcie_error_reporting(struct pci_dev *dev) | |||
35 | u16 reg16 = 0; | 35 | u16 reg16 = 0; |
36 | int pos; | 36 | int pos; |
37 | 37 | ||
38 | if (dev->aer_firmware_first) | ||
39 | return -EIO; | ||
40 | |||
38 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | 41 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
39 | if (!pos) | 42 | if (!pos) |
40 | return -EIO; | 43 | return -EIO; |
@@ -60,6 +63,9 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev) | |||
60 | u16 reg16 = 0; | 63 | u16 reg16 = 0; |
61 | int pos; | 64 | int pos; |
62 | 65 | ||
66 | if (dev->aer_firmware_first) | ||
67 | return -EIO; | ||
68 | |||
63 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 69 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
64 | if (!pos) | 70 | if (!pos) |
65 | return -EIO; | 71 | return -EIO; |
@@ -874,8 +880,22 @@ void aer_delete_rootport(struct aer_rpc *rpc) | |||
874 | */ | 880 | */ |
875 | int aer_init(struct pcie_device *dev) | 881 | int aer_init(struct pcie_device *dev) |
876 | { | 882 | { |
877 | if (aer_osc_setup(dev) && !forceload) | 883 | if (dev->port->aer_firmware_first) { |
878 | return -ENXIO; | 884 | dev_printk(KERN_DEBUG, &dev->device, |
885 | "PCIe errors handled by platform firmware.\n"); | ||
886 | goto out; | ||
887 | } | ||
888 | |||
889 | if (aer_osc_setup(dev)) | ||
890 | goto out; | ||
879 | 891 | ||
880 | return 0; | 892 | return 0; |
893 | out: | ||
894 | if (forceload) { | ||
895 | dev_printk(KERN_DEBUG, &dev->device, | ||
896 | "aerdrv forceload requested.\n"); | ||
897 | dev->port->aer_firmware_first = 0; | ||
898 | return 0; | ||
899 | } | ||
900 | return -ENXIO; | ||
881 | } | 901 | } |