Page MenuHomeFreeBSD
Paste P619

Command-Line Input
ActivePublic

Authored by jhb on Jan 9 2024, 6:04 PM.
Tags
None
Referenced Files
F74547496: Command-Line Input
Jan 9 2024, 6:04 PM
Subscribers
None
diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c
index 6a3d9d10edd4..0514efb303c7 100644
--- a/sys/dev/acpica/acpi_apei.c
+++ b/sys/dev/acpica/acpi_apei.c
@@ -665,6 +665,7 @@ apei_attach(device_t dev)
struct acpi_softc *acpi_sc;
struct apei_pges *pges;
struct apei_ge *ge;
+ struct resource *ack;
ACPI_STATUS status;
int rid;
@@ -698,6 +699,7 @@ apei_attach(device_t dev)
AcpiPutTable((ACPI_TABLE_HEADER *)sc->hest);
rid = 0;
+ ack = NULL;
TAILQ_FOREACH(ge, &sc->ges, link) {
ge->res_rid = rid++;
acpi_bus_alloc_gas(dev, &ge->res_type, &ge->res_rid,
@@ -709,11 +711,16 @@ apei_attach(device_t dev)
device_printf(dev, "Can't allocate status resource.\n");
}
if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) {
- ge->res2_rid = rid++;
- acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid,
- &ge->v2.ReadAckRegister, &ge->res2, 0);
- if (ge->res2 == NULL)
- device_printf(dev, "Can't allocate ack resource.\n");
+ if (ack != NULL && rman_get_start(ack) ==
+ ge->v2.ReadAckRegister.Address)
+ ge->res2 = ack;
+ else {
+ ge->res2_rid = rid++;
+ acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid,
+ &ge->v2.ReadAckRegister, &ge->res2, 0);
+ if (ge->res2 == NULL)
+ device_printf(dev, "Can't allocate ack resource.\n");
+ }
}
if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) {
pges = &sc->pges[PGE_ID(ge)];

Event Timeline