Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P620
Command-Line Input
Active
Public
Actions
Authored by
jhb
on Jan 9 2024, 6:06 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F74547545: Command-Line Input
Jan 9 2024, 6:06 PM
2024-01-09 18:06:25 (UTC+0)
Subscribers
None
diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c
index 6a3d9d10edd4..3bab46b23978 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,19 @@ 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_rid = -1;
+ 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");
+ else if (ack == NULL)
+ ack = ge->res2;
+ }
}
if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) {
pges = &sc->pges[PGE_ID(ge)];
@@ -770,7 +780,7 @@ apei_detach(device_t dev)
bus_release_resource(dev, ge->res_type,
ge->res_rid, ge->res);
}
- if (ge->res2) {
+ if (ge->res2 != NULL && ge->res2_rid >= 0) {
bus_release_resource(dev, ge->res2_type,
ge->res2_rid, ge->res2);
}
Event Timeline
jhb
created this paste.
Jan 9 2024, 6:06 PM
2024-01-09 18:06:25 (UTC+0)
Log In to Comment