diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-19 22:54:56 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:10 -0500 |
commit | 24f8c827f9b8ab2c8644f7ab85a1b1d58fc0fcf7 (patch) | |
tree | b9f13bc4004b9300c07f271f7280a17388230736 /arch/powerpc/kernel/pci_32.c | |
parent | 50c9bc2fc86fddd39eea6a12ceb81585bc2aafaa (diff) |
[POWERPC] Updates/fixes to 32 bits pcibios_enable_device()
Our implementation of pcibios_enable_device() incorrectly ignores
the mask argument and always checks that all resources have been
allocated, which isn't the right thing to do anymore.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index ce7c20c8191f..12b74fd098ee 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -530,10 +530,16 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
530 | 530 | ||
531 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | 531 | pci_read_config_word(dev, PCI_COMMAND, &cmd); |
532 | old_cmd = cmd; | 532 | old_cmd = cmd; |
533 | for (idx=0; idx<6; idx++) { | 533 | for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) { |
534 | /* Only set up the requested stuff */ | ||
535 | if (!(mask & (1 << idx))) | ||
536 | continue; | ||
534 | r = &dev->resource[idx]; | 537 | r = &dev->resource[idx]; |
538 | if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) | ||
539 | continue; | ||
535 | if (r->flags & IORESOURCE_UNSET) { | 540 | if (r->flags & IORESOURCE_UNSET) { |
536 | printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev)); | 541 | printk(KERN_ERR "PCI: Device %s not available because" |
542 | " of resource collisions\n", pci_name(dev)); | ||
537 | return -EINVAL; | 543 | return -EINVAL; |
538 | } | 544 | } |
539 | if (r->flags & IORESOURCE_IO) | 545 | if (r->flags & IORESOURCE_IO) |