diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-19 22:55:00 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:13 -0500 |
commit | bcf988a19458f08950551f66c110e41fac452b2b (patch) | |
tree | d0adeb1205ba09c549ed21430149998b6fc026fa /arch | |
parent | 295f83e7aaa87d52b8d16077225a90dab61df45a (diff) |
[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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 8935661d12d0..b6d4767e4e27 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1147,7 +1147,10 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
1147 | r = &dev->resource[idx]; | 1147 | r = &dev->resource[idx]; |
1148 | if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) | 1148 | if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) |
1149 | continue; | 1149 | continue; |
1150 | if (r->flags & IORESOURCE_UNSET) { | 1150 | if ((idx == PCI_ROM_RESOURCE) && |
1151 | (!(r->flags & IORESOURCE_ROM_ENABLE))) | ||
1152 | continue; | ||
1153 | if (r->parent == NULL) { | ||
1151 | printk(KERN_ERR "PCI: Device %s not available because" | 1154 | printk(KERN_ERR "PCI: Device %s not available because" |
1152 | " of resource collisions\n", pci_name(dev)); | 1155 | " of resource collisions\n", pci_name(dev)); |
1153 | return -EINVAL; | 1156 | return -EINVAL; |