]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Revert "[POWERPC] Disable PCI IO/Mem on a device when resources can't be allocated"
authorPaul Mackerras <paulus@samba.org>
Sun, 30 Dec 2007 23:04:15 +0000 (10:04 +1100)
committerPaul Mackerras <paulus@samba.org>
Sun, 30 Dec 2007 23:12:45 +0000 (10:12 +1100)
This reverts commit 553aa7659bc0e188348f64e978343ed984eb6e56 at Ben H's
request, because it confused IORESOURCE_* flags with command register
bits.

Requested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/pci-common.c

index 571854f2906c7ddeec465ecd451e767231babb62..d394d41b61d5be6e41adaea4ee16727f9c614cfd 100644 (file)
@@ -1035,7 +1035,7 @@ clear_resource:
        }
 }
 
-static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
+static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
 {
        struct resource *pr, *r = &dev->resource[idx];
 
@@ -1059,10 +1059,7 @@ static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
                r->flags |= IORESOURCE_UNSET;
                r->end -= r->start;
                r->start = 0;
-
-               return -EBUSY;
        }
-       return 0;
 }
 
 static void __init pcibios_allocate_resources(int pass)
@@ -1084,12 +1081,8 @@ static void __init pcibios_allocate_resources(int pass)
                                disabled = !(command & PCI_COMMAND_IO);
                        else
                                disabled = !(command & PCI_COMMAND_MEMORY);
-                       if (pass == disabled && alloc_resource(dev, idx)) {
-                               command &= ~(r->flags & (IORESOURCE_IO |
-                                                        IORESOURCE_MEM));
-                               pci_write_config_word(dev,
-                                                     PCI_COMMAND, command);
-                       }
+                       if (pass == disabled)
+                               alloc_resource(dev, idx);
                }
                if (pass)
                        continue;