freebsd-src/sys/dev/acpica
John Baldwin 98056127dd acpi/pci/vmd: Fix a nit with nested resource mapping requests
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.

Reviewed by:	imp
Fixes:		0e1246e334 acpi: Cleanup handling of suballocated resources
Fixes:		b377ff8110 pcib: Refine handling of resources allocated from bridge windows
Fixes:		d79b6b8ec2 pci_host_generic: Don't rewrite resource start address for translation
Fixes:		d714e73f78 vmd: Use bus_generic_rman_* for PCI bus and memory resources
Differential Revision:	https://reviews.freebsd.org/D45433
2024-06-04 16:51:14 -07:00
..
Osd pci_cfgreg: Add a PCI domain argument to the low-level register API 2023-11-29 10:31:47 -08:00
acpi.c acpi/pci/vmd: Fix a nit with nested resource mapping requests 2024-06-04 16:51:14 -07:00
acpi_acad.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_apei.c apei: Mark ReadAckRegister resource as shareable 2024-01-09 16:07:34 -05:00
acpi_battery.c acpi_battery: avoid divide-by-zero when no devices have capacity info 2024-04-16 19:39:45 -04:00
acpi_bus_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_button.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_cmbat.c acpi_cmbat: Use nitems instead of sizeof 2024-04-19 16:44:57 -06:00
acpi_container.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
acpi_cpu.c acpi_cpu: Reduce BUS_MASTER_RLD manipulations 2023-12-25 21:43:20 -05:00
acpi_dock.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_ec.c acpi: Use device_set_descf() 2024-06-02 19:38:41 -04:00
acpi_ged.c acpi_ged: Handle events directly 2023-10-12 11:27:44 -04:00
acpi_hpet.c acpi_hpet: Make use of enum for vm_guest to improve readability 2024-03-24 23:31:22 +08:00
acpi_hpet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_isab.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_lid.c acpi_lid: Remove duplicate events 2023-12-23 21:33:51 -05:00
acpi_package.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
acpi_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pci_link.c acpi: Use device_set_descf() 2024-06-02 19:38:41 -04:00
acpi_pcib.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcib_acpi.c new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE 2024-03-13 15:05:54 -07:00
acpi_pcib_pci.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pcibvar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_pcivar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_perf.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_powerres.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_pxm.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_quirk.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
acpi_quirks sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
acpi_resource.c acpi: Allow child drivers to use bus_set_resource for more resources 2024-02-14 14:07:32 -08:00
acpi_smbat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_smbus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpi_thermal.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_throttle.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpi_timer.c acpi: Use device_set_descf() 2024-06-02 19:38:41 -04:00
acpi_video.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
acpiio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
acpivar.h acpi: Cleanup handling of suballocated resources 2024-02-09 10:27:45 -08:00