Message ID | 20090802171550.GC3711@parisc-linux.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Sun, 2 Aug 2009, Matthew Wilcox wrote: > > It *might* break HP's ia64 machines. I have this feeling that the serial > ports may be claimed in the resource tree before the PCI resources are > claimed (and then they need to nest under a PCI bus). > > How about this variant which will insert_resource for _bus_ resources, > but request_resource for _device_ resources? Ugh. Please no. Hackery like this will just lead to unmaintainable crud in the long run. Can you just fix ia64 instead? The firmware resources should be added _after_ the PCI resource tree has been walked, not before. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sun, Aug 02, 2009 at 10:19:42AM -0700, Linus Torvalds wrote: > On Sun, 2 Aug 2009, Matthew Wilcox wrote: > > > > It *might* break HP's ia64 machines. I have this feeling that the serial > > ports may be claimed in the resource tree before the PCI resources are > > claimed (and then they need to nest under a PCI bus). > > > > How about this variant which will insert_resource for _bus_ resources, > > but request_resource for _device_ resources? > > Ugh. Please no. Hackery like this will just lead to unmaintainable crud in > the long run. Can you just fix ia64 instead? The firmware resources should > be added _after_ the PCI resource tree has been walked, not before. I'll take a look later if Andrew doesn't beat me to it. I still happen to have two of those machines in my basement. But my wife is hassling me to go out now (it's not crazy 40C in Ottawa ...)
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index ec80b88..8384cb3 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -100,17 +100,21 @@ int pci_claim_resource(struct pci_dev *dev, int resource) { struct resource *res = &dev->resource[resource]; struct resource *root; - char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; int err; root = pci_find_parent_resource(dev, res); err = -EINVAL; - if (root != NULL) - err = insert_resource(root, res); + if (root != NULL) { + if (resource < PCI_BRIDGE_RESOURCES) + err = request_resource(root, res); + else + err = insert_resource(root, res); + } if (err) { - dev_err(&dev->dev, "BAR %d: %s of %s %pR\n", + const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; + dev_err(&dev->dev, "BAR %d: %s %s %pR\n", resource, root ? "address space collision on" : "no parent found for",