Commit c770cb4c authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: Mark invalid BARs as unassigned

If a BAR is not inside any upstream bridge window, or if it conflicts with
another resource, mark it as IORESOURCE_UNSET so we don't try to use it.
We may be able to assign a different address for it.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent f7834c09
...@@ -120,6 +120,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -120,6 +120,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
if (!root) { if (!root) {
dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n",
resource, res); resource, res);
res->flags |= IORESOURCE_UNSET;
return -EINVAL; return -EINVAL;
} }
...@@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
if (conflict) { if (conflict) {
dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n",
resource, res, conflict->name, conflict); resource, res, conflict->name, conflict);
res->flags |= IORESOURCE_UNSET;
return -EBUSY; return -EBUSY;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment