PCI/AER: Ignore non-PCIe AER error sources in aer_hest_parse()
aer_set_firmware_first() searches the HEST for an error source descriptor matching the specified PCI device. It uses the apei_hest_parse() iterator to call aer_hest_parse() for every descriptor in the HEST. Previously, aer_hest_parse() incorrectly assumed every descriptor was for a PCIe error source. This patch adds a check to avoid that error. [bhelgaas: factor check into helper, use in aer_hest_parse_aff(), changelog] Signed-off-by: Betty Dall <betty.dall@hp.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
committed by
Bjorn Helgaas
parent
1c38108a08
commit
8e7f8d0b30
@@ -50,12 +50,24 @@ struct aer_hest_parse_info {
|
|||||||
int firmware_first;
|
int firmware_first;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int hest_source_is_pcie_aer(struct acpi_hest_header *hest_hdr)
|
||||||
|
{
|
||||||
|
if (hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
|
||||||
|
hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
|
||||||
|
hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
|
static int aer_hest_parse(struct acpi_hest_header *hest_hdr, void *data)
|
||||||
{
|
{
|
||||||
struct aer_hest_parse_info *info = data;
|
struct aer_hest_parse_info *info = data;
|
||||||
struct acpi_hest_aer_common *p;
|
struct acpi_hest_aer_common *p;
|
||||||
int ff;
|
int ff;
|
||||||
|
|
||||||
|
if (!hest_source_is_pcie_aer(hest_hdr))
|
||||||
|
return 0;
|
||||||
|
|
||||||
p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
|
p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
|
||||||
ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
|
ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
|
||||||
if (p->flags & ACPI_HEST_GLOBAL) {
|
if (p->flags & ACPI_HEST_GLOBAL) {
|
||||||
@@ -104,16 +116,13 @@ static int aer_hest_parse_aff(struct acpi_hest_header *hest_hdr, void *data)
|
|||||||
if (aer_firmware_first)
|
if (aer_firmware_first)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (hest_hdr->type) {
|
if (!hest_source_is_pcie_aer(hest_hdr))
|
||||||
case ACPI_HEST_TYPE_AER_ROOT_PORT:
|
return 0;
|
||||||
case ACPI_HEST_TYPE_AER_ENDPOINT:
|
|
||||||
case ACPI_HEST_TYPE_AER_BRIDGE:
|
|
||||||
p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
|
p = (struct acpi_hest_aer_common *)(hest_hdr + 1);
|
||||||
aer_firmware_first = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
|
aer_firmware_first = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
|
||||||
default:
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* aer_acpi_firmware_first - Check if APEI should control AER.
|
* aer_acpi_firmware_first - Check if APEI should control AER.
|
||||||
|
|||||||
Reference in New Issue
Block a user