aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/aer
diff options
context:
space:
mode:
authorMatt Domsch <Matt_Domsch@dell.com>2009-11-02 12:51:24 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-04 16:06:25 -0500
commit0584396157ad2d008e2cc76b4ed6254151183a25 (patch)
tree8860a033938b1a01cccf9a203208f741758724ac /drivers/pci/pcie/aer
parent8792e11f1c54bcba34412f03959e70ee217f2231 (diff)
PCI: PCIe AER: honor ACPI HEST FIRMWARE FIRST mode
Feedback from Hidetoshi Seto and Kenji Kaneshige incorporated. This correctly handles PCI-X bridges, PCIe root ports and endpoints, and prints debug messages when invalid/reserved types are found in the HEST. PCI devices not in domain/segment 0 are not represented in HEST, thus will be ignored. Today, the PCIe Advanced Error Reporting (AER) driver attaches itself to every PCIe root port for which BIOS reports it should, via ACPI _OSC. However, _OSC alone is insufficient for newer BIOSes. Part of ACPI 4.0 is the new APEI (ACPI Platform Error Interfaces) which is a way for OS and BIOS to handshake over which errors for which components each will handle. One table in ACPI 4.0 is the Hardware Error Source Table (HEST), where BIOS can define that errors for certain PCIe devices (or all devices), should be handled by BIOS ("Firmware First mode"), rather than be handled by the OS. Dell PowerEdge 11G server BIOS defines Firmware First mode in HEST, so that it may manage such errors, log them to the System Event Log, and possibly take other actions. The aer driver should honor this, and not attach itself to devices noted as such. Furthermore, Kenji Kaneshige reminded us to disallow changing the AER registers when respecting Firmware First mode. Platform firmware is expected to manage these, and if changes to them are allowed, it could break that firmware's behavior. The HEST parsing code may be replaced in the future by a more feature-rich implementation. This patch provides the minimum needed to prevent breakage until that implementation is available. Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/aer')
-rw-r--r--drivers/pci/pcie/aer/aerdrv_core.c24
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 */
875int aer_init(struct pcie_device *dev) 881int 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;
893out:
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}