diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 13:30:06 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 19:52:12 -0400 |
commit | c770cb4cb505c096eaca0fbbca3169c3aa4c3474 (patch) | |
tree | 5a6a5aad5fe73d4f9c80d66cac666232949533e7 /drivers/pci | |
parent | f7834c092c42995e9f3611b7d186e9dfdb8430cc (diff) |
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) | |||
120 | if (!root) { | 120 | if (!root) { |
121 | dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", | 121 | dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", |
122 | resource, res); | 122 | resource, res); |
123 | res->flags |= IORESOURCE_UNSET; | ||
123 | return -EINVAL; | 124 | return -EINVAL; |
124 | } | 125 | } |
125 | 126 | ||
@@ -127,6 +128,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) | |||
127 | if (conflict) { | 128 | if (conflict) { |
128 | dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", | 129 | dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", |
129 | resource, res, conflict->name, conflict); | 130 | resource, res, conflict->name, conflict); |
131 | res->flags |= IORESOURCE_UNSET; | ||
130 | return -EBUSY; | 132 | return -EBUSY; |
131 | } | 133 | } |
132 | 134 | ||