Skip to contentSkip to conversation

ACPI: APEI: Filter the PCI MCFG address with an arch-agnostic method

PATCH Superseded Xuesong Chen 1 participant 1 message Oct 8, 2021

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 ACPI: APEI: Filter the PCI MCFG address with an arch-agnostic method

The commit d91525eb8ee6 ("ACPI, EINJ: Enhance error injection tolerance level") fixes the issue that the ACPI/APEI can not access the PCI MCFG address on x86 platform, but this issue can also happen on other architectures, for instance, we got below error message on arm64 platform:
...
APEI: Can not request [mem 0x50100000-0x50100003] for APEI EINJ Trigger registers
...

This patch will try to handle this case in a more common way instead of the original 'arch' specific solution, which will be beneficial to all the APEI-dependent platforms after that.

---
 arch/x86/pci/mmconfig-shared.c | 28 -------------------------
 drivers/acpi/apei/apei-base.c  | 46 +++++++++++++++++++++++++++---------------
 2 files changed, 30 insertions(+), 44 deletions(-)
arch/x86/pci/mmconfig-shared.c +0 -28
index 0b961fe6..12f7d96 100644
@@ -605,32 +605,6 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
 	return 0;
 }
 
-#ifdef CONFIG_ACPI_APEI
-extern int (*arch_apei_filter_addr)(int (*func)(__u64 start, __u64 size,
-				     void *data), void *data);
-
-static int pci_mmcfg_for_each_region(int (*func)(__u64 start, __u64 size,
-				     void *data), void *data)
-{
-	struct pci_mmcfg_region *cfg;
-	int rc;
-
-	if (list_empty(&pci_mmcfg_list))
-		return 0;
-
-	list_for_each_entry(cfg, &pci_mmcfg_list, list) {
-		rc = func(cfg->res.start, resource_size(&cfg->res), data);
-		if (rc)
-			return rc;
-	}
-
-	return 0;
-}
-#define set_apei_filter() (arch_apei_filter_addr = pci_mmcfg_for_each_region)
-#else
-#define set_apei_filter()
-#endif
-
 static void __init __pci_mmcfg_init(int early)
 {
 	pci_mmcfg_reject_broken(early);
@@ -665,8 +639,6 @@ void __init pci_mmcfg_early_init(void)
 		else
 			acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
 		__pci_mmcfg_init(1);
-
-		set_apei_filter();
 	}
 }
 
drivers/acpi/apei/apei-base.c +30 -16

77 lines not on this page · raw message

Signature · 1 line
1.8.3.1