Commit bcf988a1 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras

[POWERPC] Various fixes to pcibios_enable_device()

Our implementation of pcibios_enable_device() has a couple of problems.

One is that it should not check IORESOURCE_UNSET, as this might be
left dangling after resource assignment (shouldn't but there are
bugs), but instead, we make it check resource->parent which should
be a reliable indication that the resource has been successfully
claimed (it's in the resource tree).

Then, we also need to skip ROM resources that haven't been enabled
as x86 does.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 295f83e7
...@@ -1147,7 +1147,10 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -1147,7 +1147,10 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
r = &dev->resource[idx]; r = &dev->resource[idx];
if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
continue; continue;
if (r->flags & IORESOURCE_UNSET) { if ((idx == PCI_ROM_RESOURCE) &&
(!(r->flags & IORESOURCE_ROM_ENABLE)))
continue;
if (r->parent == NULL) {
printk(KERN_ERR "PCI: Device %s not available because" printk(KERN_ERR "PCI: Device %s not available because"
" of resource collisions\n", pci_name(dev)); " of resource collisions\n", pci_name(dev));
return -EINVAL; return -EINVAL;
......
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