]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Perform reset_resource() and build fail list in sync
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Dec 2024 17:56:31 +0000 (19:56 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Feb 2025 21:40:54 +0000 (15:40 -0600)
commit96336ec702643aec2addb3b1cdb81d687fe362f0
tree487c498bec5d39c32333c7f897dc2c0d9f8c0d32
parente89df6d2beae847e931d84a190b192dfac41eba7
PCI: Perform reset_resource() and build fail list in sync

Resetting a resource is problematic as it prevents attempting to allocate
the resource later, unless something in between restores the resource.
Similarly, if fail_head does not contain all resources that were reset,
those resources cannot be restored later.

The entire reset/restore cycle adds complexity and leaving resources in the
reset state causes issues to other code such as for checks done in
pci_enable_resources(). Take a small step towards not resetting resources
by delaying reset until the end of resource assignment and build failure
list (fail_head) in sync with the reset to avoid leaving behind resources
that cannot be restored (for the case where the caller provides fail_head
in the first place to allow restore somewhere in the callchain, as is not
all callers pass non-NULL fail_head).

Leave the Expansion ROM check temporarily in place while building the
failure list until an upcoming change that reworks optional resource
handling.

Ideally, whole resource reset could be removed but doing that in one step
would be non-tractable due to complexity of all related code.

Link: https://lore.kernel.org/r/20241216175632.4175-25-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
drivers/pci/setup-bus.c