aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/pci
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2007-02-13 07:26:20 -0500
committerAndi Kleen <andi@basil.nowhere.org>2007-02-13 07:26:20 -0500
commit56829d1982b6f1150553c049d372728b9eda5aec (patch)
tree87f82f60df288579fe53dec2f45164b3636758b0 /arch/i386/pci
parent429d512e532ec9c969aa6f66ddbc542f3a5fe4da (diff)
[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 <hirofumi@mail.parknet.co.jp> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/pci')
-rw-r--r--arch/i386/pci/mmconfig-shared.c12
-rw-r--r--arch/i386/pci/mmconfig.c6
-rw-r--r--arch/i386/pci/pci.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/i386/pci/mmconfig-shared.c
index 4ea0852487a4..473db6257013 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)
43 if (val1 == 0xffffffff) 43 if (val1 == 0xffffffff)
44 continue; 44 continue;
45 45
46 raw_pci_ops->read(0, bus, devfn, 0, 4, &val2); 46 if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
47 if (val1 != val2) { 47 raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
48 set_bit(i + 32 * bus, pci_mmcfg_fallback_slots); 48 if (val1 == val2)
49 printk(KERN_NOTICE "PCI: No mmconfig possible" 49 continue;
50 " on device %02x:%02x\n", bus, i);
51 } 50 }
51 set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
52 printk(KERN_NOTICE "PCI: No mmconfig possible on device"
53 " %02x:%02x\n", bus, i);
52 } 54 }
53 } 55 }
54} 56}
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 11be089efd7d..bb1afd9e589d 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -136,6 +136,12 @@ static struct pci_raw_ops pci_mmcfg = {
136 .write = pci_mmcfg_write, 136 .write = pci_mmcfg_write,
137}; 137};
138 138
139int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
140 unsigned int devfn)
141{
142 return get_base_addr(seg, bus, devfn) != 0;
143}
144
139int __init pci_mmcfg_arch_init(void) 145int __init pci_mmcfg_arch_init(void)
140{ 146{
141 printk(KERN_INFO "PCI: Using MMCONFIG\n"); 147 printk(KERN_INFO "PCI: Using MMCONFIG\n");
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index 2ce3d44b09d4..e58bae2076ad 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -101,4 +101,6 @@ extern void pcibios_sort(void);
101#define PCI_MMCFG_MAX_CHECK_BUS 16 101#define PCI_MMCFG_MAX_CHECK_BUS 16
102extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS); 102extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
103 103
104extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
105 unsigned int devfn);
104extern int __init pci_mmcfg_arch_init(void); 106extern int __init pci_mmcfg_arch_init(void);