Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56829d1982b6f1150553c049d372728b9eda5aec
Commit:     56829d1982b6f1150553c049d372728b9eda5aec
Parent:     429d512e532ec9c969aa6f66ddbc542f3a5fe4da
Author:     OGAWA Hirofumi <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:20 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:20 2007 +0100

    [PATCH] mmconfig: fix unreachable_devices()
    
    Currently, unreachable_devices() compares value of mmconfig and value
    of conf1. But it doesn't check the device is reachable or not.
    
    Signed-off-by: OGAWA Hirofumi <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
---
 arch/i386/pci/mmconfig-shared.c |   12 +++++++-----
 arch/i386/pci/mmconfig.c        |    6 ++++++
 arch/i386/pci/pci.h             |    2 ++
 arch/x86_64/pci/mmconfig.c      |    6 ++++++
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/i386/pci/mmconfig-shared.c
index 4ea0852..473db62 100644
--- a/arch/i386/pci/mmconfig-shared.c
+++ b/arch/i386/pci/mmconfig-shared.c
@@ -43,12 +43,14 @@ static void __init unreachable_devices(void)
                        if (val1 == 0xffffffff)
                                continue;
 
-                       raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
-                       if (val1 != val2) {
-                               set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
-                               printk(KERN_NOTICE "PCI: No mmconfig possible"
-                                      " on device %02x:%02x\n", bus, i);
+                       if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
+                               raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
+                               if (val1 == val2)
+                                       continue;
                        }
+                       set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
+                       printk(KERN_NOTICE "PCI: No mmconfig possible on device"
+                              " %02x:%02x\n", bus, i);
                }
        }
 }
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 11be089..bb1afd9 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -136,6 +136,12 @@ static struct pci_raw_ops pci_mmcfg = {
        .write =        pci_mmcfg_write,
 };
 
+int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
+                                   unsigned int devfn)
+{
+       return get_base_addr(seg, bus, devfn) != 0;
+}
+
 int __init pci_mmcfg_arch_init(void)
 {
        printk(KERN_INFO "PCI: Using MMCONFIG\n");
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index 2ce3d44..e58bae2 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -101,4 +101,6 @@ extern void pcibios_sort(void);
 #define PCI_MMCFG_MAX_CHECK_BUS 16
 extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
 
+extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
+                                          unsigned int devfn);
 extern int __init pci_mmcfg_arch_init(void);
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 918fc5b..65d8273 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -126,6 +126,12 @@ static void __iomem * __init mcfg_ioremap(struct 
acpi_mcfg_allocation *cfg)
        return addr;
 }
 
+int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
+                                   unsigned int devfn)
+{
+       return pci_dev_base(seg, bus, devfn) != NULL;
+}
+
 int __init pci_mmcfg_arch_init(void)
 {
        int i;
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to