opnsense-src/sys/dev/acpica
Colin Percival 43933d89a3 acpi_pci: Add quirk for DELAY-after-EJ0
On some EC2 instances, there is a race between removing a device from
the system and making the PCI bus stop reporting the presence of the
device.  As a result, a PCI BUS_RESCAN performed immediately after
the _EJ0 method returns "sees" the device which is being ejected, which
then causes problems later (e.g. we won't recognize a new device being
plugged into that slot because we never knew it was vacant).

On other operating systems the bus is synchronously marked as needing
to be rescanned but the rescan does not occur until O(1) seconds later.

Create a new ACPI_Q_DELAY_BEFORE_EJECT_RESCAN quirk and set it in EC2
AMIs, and add a 10 ms DELAY between _EJ0 and BUS_RESCAN when tht quirk
is set.

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

(cherry picked from commit 55c3348ed78fb1d0891e8bb51a8948f95da3560b)
2025-04-14 09:09:49 -07:00
..
Osd pci_cfgreg: Add a PCI domain argument to the low-level register API 2024-01-18 14:44:51 -08:00
acpi.c acpi/pci/vmd: Fix a nit with nested resource mapping requests 2025-02-27 08:09:23 -05:00
acpi_acad.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_apei.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_battery.c acpi_battery: avoid divide-by-zero when no devices have capacity info 2024-04-19 03:16:52 +00:00
acpi_bus_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_button.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_cmbat.c acpi_cmbat: Use nitems instead of sizeof 2025-03-25 19:28:37 -06:00
acpi_container.c Use bus_generic_detach directly instead of a wrapper 2025-02-27 12:08:57 -05:00
acpi_cpu.c Use the correct idle routine on recent AMD EPYC servers 2025-02-24 13:11:34 -05:00
acpi_dock.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_ec.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_ged.c acpi_ged: Handle events directly 2024-10-28 19:02:24 -04:00
acpi_hpet.c acpi_hpet: Make use of enum for vm_guest to improve readability 2024-03-31 23:54:48 +08:00
acpi_hpet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_isab.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_lid.c acpi_lid: Remove duplicate events 2024-01-19 11:39:28 -05:00
acpi_package.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pci.c acpi_pci: Add quirk for DELAY-after-EJ0 2025-04-14 09:09:49 -07:00
acpi_pci_link.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_pcib.c acpica: Extract _OSC parsing to a common file 2025-04-01 10:43:57 -07:00
acpi_pcib_acpi.c acpi: Pass the correct device to acpi_pcib_osc 2025-04-08 17:35:45 +00:00
acpi_pcib_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcibvar.h acpica: Extract _OSC parsing to a common file 2025-04-01 10:43:57 -07:00
acpi_pcivar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_perf.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_powerres.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pxm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirk.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirks sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_resource.c acpi: Cleanup handling of suballocated resources 2025-02-27 08:09:21 -05:00
acpi_smbat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_smbus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_thermal.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_throttle.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_timer.c acpi: Use device_set_descf() 2024-06-09 09:37:55 -04:00
acpi_video.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpiio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpivar.h acpi_pci: Add quirk for DELAY-after-EJ0 2025-04-14 09:09:49 -07:00