]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
acpi: Only reserve resources enumerated via _CRS
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2024 19:23:10 +0000 (11:23 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Jan 2024 19:23:10 +0000 (11:23 -0800)
commitc6a488511ab1fbae8d16264b9e83c85024c9e1ce
treec1f16419cffda8f1d1ccd661cd1eb860061518ab
parenta9b615120628411cc20af730edb291c52be02f66
acpi: Only reserve resources enumerated via _CRS

In particular, don't reserve resources added by drivers via other
means (e.g. acpi_bus_alloc_gas which calls bus_alloc_resource
right after adding the resource).

The intention of reserved resources is to ensure that a resource range
that a bus driver knows is assigned to a device is reserved by the
system even if no driver is attached to the device.  This prevents
other "wildcard" resource requests from conflicting with these
resources.  For ACPI, the only resources the bus driver knows about
for unattached devices are the resources returned from _CRS.  All of
these resources are already reserved now via acpi_reserve_resources
called from acpi_probe_children.

As such, remove the logic from acpi_set_resource to try to reserve
resources when they are set.  This permits RF_SHAREABLE to work with
acpi_bus_alloc_gas without requiring hacks like the current one for
CPU device resources in acpi_set_resource.

Reported by: gallatin (RF_SHAREABLE not working)
Diagnosed by: jrtc27
sys/dev/acpica/acpi.c
sys/dev/acpica/acpivar.h