]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Cache offset of Resizable BAR capability
authorBjorn Helgaas <bhelgaas@google.com>
Sat, 15 Feb 2025 00:03:01 +0000 (18:03 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 10 Mar 2025 18:41:47 +0000 (13:41 -0500)
commita7eb9124d92be1330afd18c98e4f28f297b50cb8
tree4de22108cc97c5787754d0ce6260d937e62f42ed
parent3f8c4959fc18e477801386a625e726c59f52a2c4
PCI: Cache offset of Resizable BAR capability

Previously most resizable BAR interfaces (pci_rebar_get_possible_sizes(),
pci_rebar_set_size(), etc) as well as pci_restore_state() searched config
space for a Resizable BAR capability.  Most devices don't have such a
capability, so this is wasted effort, especially for pci_restore_state().

Search for a Resizable BAR capability once at enumeration-time and cache
the offset so we don't have to search every time we need it.  No functional
change intended.

Link: https://lore.kernel.org/r/20250215000301.175097-3-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/probe.c
include/linux/pci.h