Commit:     bcf988a19458f08950551f66c110e41fac452b2b
Parent:     295f83e7aaa87d52b8d16077225a90dab61df45a
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 20 14:55:00 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Dec 20 16:18:13 2007 +1100

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 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 8935661..b6d4767 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)
                r = &dev->resource[idx];
                if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
-               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"
                               " of resource collisions\n", pci_name(dev));
                        return -EINVAL;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to