diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2007-02-13 13:26:20 +0100 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 13:26:20 +0100 |
commit | 44de0203fab205417b24322272c53ee0883c36e7 (patch) | |
tree | c5dbfa7e373ab07f517fc91fd97ff45045ccbb1b /arch/x86_64 | |
parent | faed197b7b44a6c4e6b81dd2db649fd452b0a7ef (diff) |
[PATCH] mmconfig: Reject a broken MCFG tables on Asus etc
This rejects broken MCFG tables on Asus. When the table
looks bogus just disable mmconfig
Arjan and Andi suggested this.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/pci/mmconfig.c | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index 8e05449660f..78e50b2c5cc 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c @@ -28,39 +28,6 @@ struct mmcfg_virt { }; static struct mmcfg_virt *pci_mmcfg_virt; -static inline int mcfg_broken(void) -{ - struct acpi_mcfg_allocation *cfg = &pci_mmcfg_config[0]; - - /* Handle more broken MCFG tables on Asus etc. - They only contain a single entry for bus 0-0. Assume - this applies to all busses. */ - if (pci_mmcfg_config_num == 1 && - cfg->pci_segment_group_number == 0 && - (cfg->start_bus_number | cfg->end_bus_number) == 0) - return 1; - return 0; -} - -static void __iomem *mcfg_ioremap(struct acpi_mcfg_allocation *cfg) -{ - void __iomem *addr; - u32 size; - - if (mcfg_broken()) - size = 256 << 20; - else - size = (cfg->end_bus_number + 1) << 20; - - addr = ioremap_nocache(cfg->base_address, size); - if (addr) { - printk(KERN_INFO "PCI: Using MMCONFIG at %x - %x\n", - cfg->base_address, - cfg->base_address + size - 1); - } - return addr; -} - static char __iomem *get_virt(unsigned int seg, unsigned bus) { int cfg_num = -1; @@ -78,9 +45,6 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) return pci_mmcfg_virt[cfg_num].virt; } - if (mcfg_broken()) - return pci_mmcfg_virt[0].virt; - /* Fall back to type 0 */ return NULL; } @@ -160,6 +124,20 @@ static struct pci_raw_ops pci_mmcfg = { .write = pci_mmcfg_write, }; +static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) +{ + void __iomem *addr; + u32 size; + + size = (cfg->end_bus_number + 1) << 20; + addr = ioremap_nocache(cfg->address, size); + if (addr) { + printk(KERN_INFO "PCI: Using MMCONFIG at %Lx - %Lx\n", + cfg->address, cfg->address + size - 1); + } + return addr; +} + int __init pci_mmcfg_arch_init(void) { int i; |