[PATCH 3/4] PCI/AER: Expose AER panic state via pci_aer_panic_enabled()
Hans Zhang
18255117159 at 163.com
Tue May 20 00:03:25 AEST 2025
On 2025/5/17 12:07, Sathyanarayanan Kuppuswamy wrote:
>
> On 5/16/25 9:55 AM, Hans Zhang wrote:
>> From: Hans Zhang <hans.zhang at cixtech.com>
>>
>> Add pci_aer_panic_enabled() to check if aer_panic is enabled system-wide.
>> Export the function for use in error recovery logic.
>>
>> Signed-off-by: Hans Zhang <hans.zhang at cixtech.com>
>> ---
>> drivers/pci/pci.h | 2 ++
>> drivers/pci/pcie/aer.c | 12 ++++++++++++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
>> index 8ddfc1677eeb..f92928dadc6a 100644
>> --- a/drivers/pci/pci.h
>> +++ b/drivers/pci/pci.h
>> @@ -959,6 +959,7 @@ static inline void
>> of_pci_remove_host_bridge_node(struct pci_host_bridge *bridge
>> #ifdef CONFIG_PCIEAER
>> void pci_no_aer(void);
>> void pci_aer_panic(void);
>> +bool pci_aer_panic_enabled(void);
>> void pci_aer_init(struct pci_dev *dev);
>> void pci_aer_exit(struct pci_dev *dev);
>> extern const struct attribute_group aer_stats_attr_group;
>> @@ -970,6 +971,7 @@ void pci_restore_aer_state(struct pci_dev *dev);
>> #else
>> static inline void pci_no_aer(void) { }
>> static inline void pci_aer_panic(void) { }
>> +static inline bool pci_aer_panic_enabled(void) { return false; }
>> static inline void pci_aer_init(struct pci_dev *d) { }
>> static inline void pci_aer_exit(struct pci_dev *d) { }
>> static inline void pci_aer_clear_fatal_status(struct pci_dev *dev) { }
>> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
>> index fa51fb8a5fe7..4fd7db90b77c 100644
>> --- a/drivers/pci/pcie/aer.c
>> +++ b/drivers/pci/pcie/aer.c
>> @@ -125,6 +125,18 @@ void pci_aer_panic(void)
>> pcie_aer_panic = true;
>> }
>> +/**
>> + * pci_aer_panic_enabled() - Are AER panic enabled system-wide?
>> + *
>> + * Return: true if AER panic has not been globally disabled through
>> ACPI FADT,
>> + * PCI bridge quirks, or the "pci=aer_panic" kernel command-line option.
>
> I don't think we have code to disable it via ACPI FADT or PCI bridge quirks
> currently, right? If yes, just list what is currently supported.
>
Dear Sathyanarayanan,
Thank you very much for your reply. You're right. If this series of
patches is supported in the discussion, I will remove the comment "ACPI
FADT, PCI bridge quirks" in the next version.
Best regards,
Hans
>> + */
>> +bool pci_aer_panic_enabled(void)
>> +{
>> + return pcie_aer_panic;
>> +}
>> +EXPORT_SYMBOL(pci_aer_panic_enabled);
>> +
>> bool pci_aer_available(void)
>> {
>> return !pcie_aer_disable && pci_msi_enabled();
>
More information about the Linuxppc-dev
mailing list