]> err.no Git - linux-2.6/blobdiff - arch/powerpc/kernel/pci-common.c
Merge branches 'release' and 'dock' into release
[linux-2.6] / arch / powerpc / kernel / pci-common.c
index d394d41b61d5be6e41adaea4ee16727f9c614cfd..89c83ccb85c10e07d5fe29375d26fb624377567d 100644 (file)
@@ -748,7 +748,13 @@ static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
                struct resource *res = dev->resource + i;
                if (!res->flags)
                        continue;
-               if (res->end == 0xffffffff) {
+               /* On platforms that have PPC_PCI_PROBE_ONLY set, we don't
+                * consider 0 as an unassigned BAR value. It's technically
+                * a valid value, but linux doesn't like it... so when we can
+                * re-assign things, we do so, but if we can't, we keep it
+                * around and hope for the best...
+                */
+               if (res->start == 0 && !(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
                        pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
                                 pci_name(dev), i,
                                 (unsigned long long)res->start,
@@ -792,9 +798,10 @@ static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
                for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
                        if ((res = bus->resource[i]) == NULL)
                                continue;
-                       if (!res->flags || bus->self->transparent)
+                       if (!res->flags)
+                               continue;
+                       if (i >= 3 && bus->self->transparent)
                                continue;
-
                        /* On PowerMac, Apple leaves bridge windows open over
                         * an inaccessible region of memory space (0...fffff)
                         * which is somewhat bogus, but that's what they think
@@ -806,7 +813,8 @@ static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
                         * equal to the pci_mem_offset of the host bridge and
                         * their size is smaller than 1M.
                         */
-                       if (res->start == hose->pci_mem_offset &&
+                       if (res->flags & IORESOURCE_MEM &&
+                           res->start == hose->pci_mem_offset &&
                            res->end < 0x100000) {
                                printk(KERN_INFO
                                       "PCI: Closing bogus Apple Firmware"