Page MenuHomeFreeBSD

acpi/pci/vmd: Fix a nit with nested resource mapping requests
ClosedPublic

Authored by jhb on Jun 1 2024, 4:13 AM.
Tags
None
Referenced Files
F102059129: D45433.diff
Thu, Nov 7, 2:50 AM
F102036067: D45433.id139283.diff
Wed, Nov 6, 7:34 PM
Unknown Object (File)
Tue, Nov 5, 2:32 PM
Unknown Object (File)
Wed, Oct 16, 6:28 PM
Unknown Object (File)
Wed, Oct 16, 9:34 AM
Unknown Object (File)
Mon, Oct 14, 2:19 PM
Unknown Object (File)
Sat, Oct 12, 5:18 PM
Unknown Object (File)
Fri, Oct 11, 8:49 AM
Subscribers
None

Details

Summary

Some bus drivers use rmans to suballocate resources to child devices.
When the driver for a child device requests a mapping for a
suballocated resource, the bus driver translates this into a mapping
request for a suitable subrange of the original resource the bus
driver allocated from its parent. This nested mapping request should
look like any other resource mapping request being made by the bus
device (i.e. as if the bus device had called bus_map_resource() or
bus_alloc_resource() with RF_ACTIVE).

I had slightly flubbed this last bit though since the direct use of
bus_generic_map/unmap_resource passed up the original child device
(second argument to the underlying kobj interface). While this is
currently harmless, it is not strictly correct as the resource being
mapped is owned by the bus device, not the child and can break for
other bus drivers in the future.

Instead, use bus_map/unmap_resource for the nested request where the
requesting device is now the bus device that owns the parent resource.

Fixes: 0e1246e33461 acpi: Cleanup handling of suballocated resources
Fixes: b377ff8110e3 pcib: Refine handling of resources allocated from bridge windows
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Fixes: d714e73f7895 vmd: Use bus_generic_rman_* for PCI bus and memory resources

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57983
Build 54871: arc lint + arc unit