Commit 966f3a75 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

PCI: for address space collisions, show conflicting resource

With request_resource_conflict(), we can learn what the actual conflict is,
so print that info for debugging purposes.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 66f1207b
...@@ -93,8 +93,7 @@ void pci_update_resource(struct pci_dev *dev, int resno) ...@@ -93,8 +93,7 @@ void pci_update_resource(struct pci_dev *dev, int resno)
int pci_claim_resource(struct pci_dev *dev, int resource) int pci_claim_resource(struct pci_dev *dev, int resource)
{ {
struct resource *res = &dev->resource[resource]; struct resource *res = &dev->resource[resource];
struct resource *root; struct resource *root, *conflict;
int err;
root = pci_find_parent_resource(dev, res); root = pci_find_parent_resource(dev, res);
if (!root) { if (!root) {
...@@ -103,12 +102,15 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -103,12 +102,15 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
return -EINVAL; return -EINVAL;
} }
err = request_resource(root, res); conflict = request_resource_conflict(root, res);
if (err) if (conflict) {
dev_err(&dev->dev, dev_err(&dev->dev,
"address space collision: %pR already in use\n", res); "address space collision: %pR conflicts with %s %pR\n",
res, conflict->name, conflict);
return -EBUSY;
}
return err; return 0;
} }
EXPORT_SYMBOL(pci_claim_resource); EXPORT_SYMBOL(pci_claim_resource);
......
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