diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 12:30:06 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 18:52:12 -0500 |
commit | c770cb4cb505c096eaca0fbbca3169c3aa4c3474 (patch) | |
tree | 5a6a5aad5fe73d4f9c80d66cac666232949533e7 /drivers/pci | |
parent | f7834c092c42995e9f3611b7d186e9dfdb8430cc (diff) | |
download | linux-c770cb4cb505c096eaca0fbbca3169c3aa4c3474.tar.bz2 |
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')
-rw-r--r-- | drivers/pci/setup-res.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index b7c3a5ea1fca..232f9254c11a 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; } |