Re: [PATCH v1 08/19] ACPI: extlog: Align extlog_print_pcie() and ghes_handle_aer()

From: Jonathan Cameron

Date: Wed Nov 18 2026 - 14:42:05 EST


On Tue, 17 Nov 2026 12:10:18 +0100
Pierre Gondois <pierre.gondois@xxxxxxx> wrote:

> In order to unify extlog_print_pcie() with ghes_handle_aer() and
> prepare to remove one of the functions, align the behaviour of the
> 2 functions. Thus:

Say which function you are changing.

> - Submit the decoded snapshot through aer_recover_queue() instead of
> just printing the error.

That's a major functional change. I'm kind of making the assumption
that something handled the aer recovery previously that wasn't via
this path? So do we now handle it twice? I can't figure out how
this works on systems using extlog but it is certainly a bold change to make :)


> - Override the mapped AER severity with AER_FATAL when CPER_SEC_RESET
> is set so the AER worker selects the frozen-channel recovery path
> when it finds an unmasked uncorrectable error.
>
> Signed-off-by: Pierre Gondois <pierre.gondois@xxxxxxx>
> ---
> drivers/acpi/acpi_extlog.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
> index 125f7931b98bc..e09ea571c32f5 100644
> --- a/drivers/acpi/acpi_extlog.c
> +++ b/drivers/acpi/acpi_extlog.c
> @@ -8,9 +8,11 @@
>
> #include <linux/module.h>
> #include <linux/acpi.h>
> +#include <linux/aer.h>
> #include <linux/cper.h>
> #include <linux/ratelimit.h>
> #include <linux/edac.h>
> +#include <linux/pci.h>
> #include <linux/ras.h>
> #include <cxl/event.h>
> #include <acpi/ghes.h>
> @@ -138,7 +140,6 @@ static void extlog_print_pcie(struct acpi_hest_generic_data *gdata)
> #ifdef CONFIG_ACPI_APEI_PCIEAER
> struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
> struct aer_capability_regs aer_regs = {};
> - struct pci_dev *pdev;
> unsigned int devfn;
> unsigned int bus;
> int aer_severity;
> @@ -156,6 +157,9 @@ static void extlog_print_pcie(struct acpi_hest_generic_data *gdata)
> return;
>
> aer_severity = cper_severity_to_aer(gdata->error_severity);
> + /* A component reset by firmware needs reinitialization. */
> + if (gdata->flags & CPER_SEC_RESET)
> + aer_severity = AER_FATAL;
>
> aer_cap_regs_unpack(&aer_regs, pcie_err->aer_info, sizeof(pcie_err->aer_info));
>
> @@ -163,12 +167,7 @@ static void extlog_print_pcie(struct acpi_hest_generic_data *gdata)
> bus = pcie_err->device_id.bus;
> devfn = PCI_DEVFN(pcie_err->device_id.device,
> pcie_err->device_id.function);
> - pdev = pci_get_domain_bus_and_slot(domain, bus, devfn);
> - if (!pdev)
> - return;
> -
> - pci_print_aer(pdev, aer_severity, &aer_regs);
> - pci_dev_put(pdev);
> + aer_recover_queue(domain, bus, devfn, aer_severity, &aer_regs);
> #endif
> }
>