diff mbox series

[v9,19/26] PCI: Don't claim fixed BARs

Message ID 20201218174011.340514-20-s.miroshnichenko@yadro.com (mailing list archive)
State New
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Allow BAR movement during boot and hotplug | expand

Commit Message

Sergei Miroshnichenko Dec. 18, 2020, 5:40 p.m. UTC
A fixed BAR always has an address, but its parent bridge window can be not
yet calculated (during boot) or temporarily released for re-calculation
(during PCI rescan) when pci_claim_resource() is called.

Apart from that, fixed BARs now have separate guaranteed mechanism of
assigning comparing to usual BARs, so claiming them is not needed.

Return immediately from pci_claim_resource() to prevent a misleading "can't
claim BAR ... no compatible bridge window" error message.

Signed-off-by: Sergei Miroshnichenko <s.miroshnichenko@yadro.com>
 drivers/pci/setup-res.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series


diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 6ffda8b94c52..28ec3d8c79c8 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -139,6 +139,9 @@  int pci_claim_resource(struct pci_dev *dev, int resource)
 		return -EINVAL;
+	if (pci_dev_bar_fixed(dev, res))
+		return 0;
 	 * If we have a shadow copy in RAM, the PCI device doesn't respond
 	 * to the shadow range, so we don't need to claim it, and upstream