ACPI: APEI: Filter the PCI MCFG address with an arch-agnostic method
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.
Signed-off-by Xuesong Chen <[email protected]>
Reported-by kernel test robot <[email protected]>
--- 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
@@ -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