]> 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>
Fri, 23 Feb 2024 05:23:38 +0000 (21:23 -0800)
commitf15ff67ef9379e2fe4909c96fb8e4153c32bafe1
treef62adbab1cb7ae377c8b42d90164277c078f2ab7
parent88bdc4bb60df6aab4457d244c5fbf4b56b22ff6d
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

(cherry picked from commit f2fcb68074a51a8b399dc80d4c03fbe98a0ab92c)
(cherry picked from commit eaa51e59e560c556d0a8273d29eea4309e6b6a4f)

Approved by: re (cperciva)
sys/dev/acpica/acpi.c