]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
acpi: Defer reserving resources for ACPI devices
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 22 Feb 2024 18:43:43 +0000 (10:43 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 22 Feb 2024 18:43:43 +0000 (10:43 -0800)
commitf2fcb68074a51a8b399dc80d4c03fbe98a0ab92c
tree8eebb519713d5983426924cc9b8e5b42ad5d5090
parent121be555997b3d7727e50d15acabd0ffbf4a4247
acpi: Defer reserving resources for ACPI devices

The goal of reserving firmware-assigned resources is to ensure that
"wildcard" resource allocation requests will not claim an address
range that is actually in use even if no attached driver is actively
using that range.  However, the current approach can break in some
cases.

In particular, ACPI can enumerate devices behind PCI bridges that
don't show up in a normal PCI scan, but those device_t objects can end
up as direct children of acpi0.  Reserving resources for those devices
directly from acpi0 ends up conflicting with later attempts to reserve
the PCI bridge windows.

As a workaround, defer reserving unclaimed resources until after the
initial probe and attach scan.  Eventually this pass of reserving
unclaimed resources can be moved earlier, but it requires changes to
other drivers in the tree to permit enumerating devices and reserving
firmware-assigned resources in a depth-first traversal before
attaching devices whose drivers request wildcard allocations.

PR: 272507
Reported by: Justin Tocci <justin@tocci.org>
Reported by: john@feith.com, many others
Tested by: Oleg Sidorkin <osidorkin@gmail.com>, dch
sys/dev/acpica/acpi.c