Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219547
b: refs/heads/master
c: b22c3d8
h: refs/heads/master
i:
  219545: 62e10a3
  219543: 8a6c46e
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Oct 15, 2010
1 parent 46e864c commit 07b206e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42b219322a97ccef347388b233aceaafe3fa517d
refs/heads/master: b22c3d82757109fa107ce17ba9484d45273eed05
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pcie/aer/aerdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static void aer_error_resume(struct pci_dev *dev)
*/
static int __init aer_service_init(void)
{
if (!pci_aer_available())
if (!pci_aer_available() || aer_acpi_firmware_first())
return -ENXIO;
return pcie_port_service_register(&aerdriver);
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/pci/pcie/aer/aerdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,16 @@ static inline int aer_osc_setup(struct pcie_device *pciedev)

#ifdef CONFIG_ACPI_APEI
extern int pcie_aer_get_firmware_first(struct pci_dev *pci_dev);
extern bool aer_acpi_firmware_first(void);
#else
static inline int pcie_aer_get_firmware_first(struct pci_dev *pci_dev)
{
if (pci_dev->__aer_firmware_first_valid)
return pci_dev->__aer_firmware_first;
return 0;
}

static inline bool aer_acpi_firmware_first(void) { return false; }
#endif

static inline void pcie_aer_force_firmware_first(struct pci_dev *pci_dev,
Expand Down
34 changes: 34 additions & 0 deletions trunk/drivers/pci/pcie/aer/aerdrv_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,38 @@ int pcie_aer_get_firmware_first(struct pci_dev *dev)
aer_set_firmware_first(dev);
return dev->__aer_firmware_first;
}

static bool aer_firmware_first;

static int aer_hest_parse_aff(struct acpi_hest_header *hest_hdr, void *data)
{
struct acpi_hest_aer_common *p;

if (aer_firmware_first)
return 0;

switch (hest_hdr->type) {
case ACPI_HEST_TYPE_AER_ROOT_PORT:
case ACPI_HEST_TYPE_AER_ENDPOINT:
case ACPI_HEST_TYPE_AER_BRIDGE:
p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
aer_firmware_first = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
default:
return 0;
}
}

/**
* aer_acpi_firmware_first - Check if APEI should control AER.
*/
bool aer_acpi_firmware_first(void)
{
static bool parsed = false;

if (!parsed) {
apei_hest_parse(aer_hest_parse_aff, NULL);
parsed = true;
}
return aer_firmware_first;
}
#endif
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pcie/portdrv_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask)
| OSC_PCI_EXPRESS_PME_CONTROL;

if (pci_aer_available()) {
if (pcie_aer_get_firmware_first(port))
if (aer_acpi_firmware_first())
dev_dbg(&port->dev, "PCIe errors handled by BIOS.\n");
else
flags |= OSC_PCI_EXPRESS_AER_CONTROL;
Expand Down

0 comments on commit 07b206e

Please sign in to comment.