summaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2015-03-12 12:30:06 -0500
committerBjorn Helgaas <bhelgaas@google.com>2015-03-12 18:52:12 -0500
commitc770cb4cb505c096eaca0fbbca3169c3aa4c3474 (patch)
tree5a6a5aad5fe73d4f9c80d66cac666232949533e7 /drivers/pci/setup-res.c
parentf7834c092c42995e9f3611b7d186e9dfdb8430cc (diff)
downloadop-kernel-dev-c770cb4cb505c096eaca0fbbca3169c3aa4c3474.zip
op-kernel-dev-c770cb4cb505c096eaca0fbbca3169c3aa4c3474.tar.gz
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: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index b7c3a5e..232f925 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -120,6 +120,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
if (!root) {
dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n",
resource, res);
+ res->flags |= IORESOURCE_UNSET;
return -EINVAL;
}
@@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
if (conflict) {
dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n",
resource, res, conflict->name, conflict);
+ res->flags |= IORESOURCE_UNSET;
return -EBUSY;
}
OpenPOWER on IntegriCloud