Commit b0b63a9d authored by Andi Kleen's avatar Andi Kleen Committed by Greg Kroah-Hartman

[PATCH] PCI: Disable mmconfig on AMD CPUs.

Disable mmconfig on AMD CPUs.

This patch fixes various problems on PCI Express boards, like the
Nforce4. They have a MCFG table in ACPI, but not all devices can be
accessed using MMCONFIG.  e.g. the CPU builtin PCI devices in the A64
Northbridge can't.  Linux happily uses mmconfig for all PCI devices and
that cause failures and memory corruption.

Right solution apparently is to get more information from MCFG which is
supposed to tell for which busses mmconfig is legal and for which ones
not. But that would be a much more complicated patch and I don't have
a specification of this enhanced table.

This patch just disable MMCONFIG on all AMD CPUs. This is a kludge,
but works around the problem for now.

Patch for both i386 and x86-64
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 415ca964
...@@ -102,6 +102,13 @@ static int __init pci_mmcfg_init(void) ...@@ -102,6 +102,13 @@ static int __init pci_mmcfg_init(void)
if (!pci_mmcfg_base_addr) if (!pci_mmcfg_base_addr)
goto out; goto out;
/* Kludge for now. Don't use mmconfig on AMD systems because
those have some busses where mmconfig doesn't work,
and we don't parse ACPI MCFG well enough to handle that.
Remove when proper handling is added. */
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
goto out;
printk(KERN_INFO "PCI: Using MMCONFIG\n"); printk(KERN_INFO "PCI: Using MMCONFIG\n");
raw_pci_ops = &pci_mmcfg; raw_pci_ops = &pci_mmcfg;
pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
......
...@@ -78,6 +78,13 @@ static int __init pci_mmcfg_init(void) ...@@ -78,6 +78,13 @@ static int __init pci_mmcfg_init(void)
if (!pci_mmcfg_base_addr) if (!pci_mmcfg_base_addr)
return 0; return 0;
/* Kludge for now. Don't use mmconfig on AMD systems because
those have some busses where mmconfig doesn't work,
and we don't parse ACPI MCFG well enough to handle that.
Remove when proper handling is added. */
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
return 0;
/* RED-PEN i386 doesn't do _nocache right now */ /* RED-PEN i386 doesn't do _nocache right now */
pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE); pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE);
if (!pci_mmcfg_virt) { if (!pci_mmcfg_virt) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment