]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: Add bridge window selection functions
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 29 Aug 2025 13:11:01 +0000 (16:11 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2025 16:19:28 +0000 (11:19 -0500)
commit74afce3dfcba117064c0eb7eb4d075836aa1370f
tree3b68f5a05a992f5be781b75a55890e5f84d808b8
parente4934832c588f72bcc139d3ca0acc490c63a821c
PCI: Add bridge window selection functions

Various places in the PCI core code independently decide into which bridge
window a child resource should be placed. It is hard to see whether these
decisions always end up in agreement, especially in the corner cases, and
in some places it requires complex logic to pass multiple resource types
and/or bridge windows around.

Add pbus_select_window() and pbus_select_window_for_type() for cases where
the former cannot be used so that eventually the same helper can be used to
select the bridge window everywhere. Using the same function ensures the
selected bridge window remains always the same and it can be easily
recalculated in-situ allowing simplifying the interfaces between internal
functions in upcoming changes.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250829131113.36754-13-ilpo.jarvinen@linux.intel.com
drivers/pci/pci.h
drivers/pci/setup-bus.c