]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: Use pbus_select_window() during BAR resize
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 29 Aug 2025 13:11:04 +0000 (16:11 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2025 16:19:38 +0000 (11:19 -0500)
commit7dc58aa7f1b32a215fb0b7c6ca30ddf4663dedf4
tree1a3c7fbdde2649c638ed8c09cb8bc39495a28980
parent85796d20a6907e8ede81380a8fa73745d486f0af
PCI: Use pbus_select_window() during BAR resize

Prior to a BAR resize, __resource_resize_store() loops through the normal
resources of the PCI device and releases those that match to the flags of
the BAR to be resized. This is necessary to allow resizing also the
upstream bridge window as only childless bridge windows can be resized.

While the flags check (mostly) works (if corner cases are ignored), the
more straightforward way is to check if the resources share the bridge
window. Change __resource_resize_store() to do the check using
pbus_select_window().

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-16-ilpo.jarvinen@linux.intel.com
drivers/pci/pci-sysfs.c