aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
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/probe.c
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/probe.c')
-rw-r--r--drivers/pci/probe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 9cefc54a0125..118463befef0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -11,6 +11,7 @@
11#include <linux/cpumask.h> 11#include <linux/cpumask.h>
12#include <linux/pci-aspm.h> 12#include <linux/pci-aspm.h>
13#include <linux/iommu.h> 13#include <linux/iommu.h>
14#include <acpi/acpi_hest.h>
14#include <xen/xen.h> 15#include <xen/xen.h>
15#include "pci.h" 16#include "pci.h"
16 17
@@ -706,6 +707,12 @@ static void set_pcie_hotplug_bridge(struct pci_dev *pdev)
706 pdev->is_hotplug_bridge = 1; 707 pdev->is_hotplug_bridge = 1;
707} 708}
708 709
710static void set_pci_aer_firmware_first(struct pci_dev *pdev)
711{
712 if (acpi_hest_firmware_first_pci(pdev))
713 pdev->aer_firmware_first = 1;
714}
715
709#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) 716#define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED)
710 717
711/** 718/**
@@ -734,6 +741,7 @@ int pci_setup_device(struct pci_dev *dev)
734 dev->multifunction = !!(hdr_type & 0x80); 741 dev->multifunction = !!(hdr_type & 0x80);
735 dev->error_state = pci_channel_io_normal; 742 dev->error_state = pci_channel_io_normal;
736 set_pcie_port_type(dev); 743 set_pcie_port_type(dev);
744 set_pci_aer_firmware_first(dev);
737 745
738 list_for_each_entry(slot, &dev->bus->slots, list) 746 list_for_each_entry(slot, &dev->bus->slots, list)
739 if (PCI_SLOT(dev->devfn) == slot->number) 747 if (PCI_SLOT(dev->devfn) == slot->number)