Skip to content

Commit

Permalink
PCI: for address space collisions, show conflicting resource
Browse files Browse the repository at this point in the history
With request_resource_conflict(), we can learn what the actual conflict is,
so print that info for debugging purposes.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Mar 24, 2010
1 parent 66f1207 commit 966f3a7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/pci/setup-res.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ void pci_update_resource(struct pci_dev *dev, int resno)
int pci_claim_resource(struct pci_dev *dev, int resource)
{
struct resource *res = &dev->resource[resource];
struct resource *root;
int err;
struct resource *root, *conflict;

root = pci_find_parent_resource(dev, res);
if (!root) {
Expand All @@ -103,12 +102,15 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
return -EINVAL;
}

err = request_resource(root, res);
if (err)
conflict = request_resource_conflict(root, res);
if (conflict) {
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);

Expand Down

0 comments on commit 966f3a7

Please sign in to comment.