HomeFreeBSD

acpi_pci: Add quirk for PSTAT_PME-before-detach

Description

acpi_pci: Add quirk for PSTAT_PME-before-detach

In order to signal to Graviton [123] systems that a device is ready
to be "ejected" (after a detach request is made via the EC2 API) we
need to set PCIM_PSTAT_PME to 1 and PCIM_PSTAT_PMEENABLE to 0. We are
not aware of any rationale for this requirement beyond "another OS
kernel happens to do this", i.e. this is effectively bug-for-bug
compatibility.

Arguably this should be done by the ACPI _EJ0 method on these systems,
but it is not.

Create a new ACPI_Q_CLEAR_PME_ON_DETACH quirk and set it in EC2 AMIs,
and add the PCI register write to acpi_pci_device_notify_handler when
that quirk is set.

Reviewed by: jhb
MFC after: 1 month
Sponsored by: Amazon
Differential Revision: https://reviews.freebsd.org/D49146

Details

Provenance
cpercivaAuthored on Feb 27 2025, 12:31 AM
Reviewer
jhb
Differential Revision
D49146: acpi_pci: Add quirk for PSTAT_PME-before-detach
Parents
rG202a2be0941e: witness.4: correct name of the debug.witness.witness_count sysctl
Branches
Unknown
Tags
Unknown