]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Work around an AMD768MPX erratum
authorAndrew Morton <akpm@osdl.org>
Sat, 13 Mar 2004 11:26:39 +0000 (03:26 -0800)
committerLen Brown <len.brown@intel.com>
Sat, 13 Mar 2004 11:26:39 +0000 (03:26 -0800)
From: Andi Kleen <ak@suse.de>

This patch has been in the SuSE 2.4 kernel forever, but for some reason
never made it mainline.

It works around the infamous "only works stable when a mouse is plugged in"
problem some AMD 768MPX Dual Athlon chipsets have.  The problem happens
because the chipset can hang when PCI prefetch strides from a RAM page into
the VGA text buffer.  When a PS2 mouse is plugged in the BIOS reserves a
page before the VGA text buffer, which stops the prefetch early.

This patch always reserves this page when the chipset could be AMD768MPX.
This can be only done early in bootmem setup.  Because it's difficult to
scan the PCI bus that early it just always reserves this page when the CPU
is an Athlon.  Normally it should not make a difference because the BIOS
will have reserved that page anyways when a PS/2 mouse is plugged in.

arch/i386/kernel/setup.c

index 1254cb8e7bacc2537dbdd2936648fb9978a07747..ee195edf051e86322fe9799d417c37cab1a52ff7 100644 (file)
@@ -832,6 +832,13 @@ static unsigned long __init setup_memory(void)
         */
        reserve_bootmem(0, PAGE_SIZE);
 
+    /* could be an AMD 768MPX chipset. Reserve a page  before VGA to prevent
+       PCI prefetch into it (errata #56). Usually the page is reserved anyways,
+       unless you have no PS/2 mouse plugged in. */
+       if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+           boot_cpu_data.x86 == 6)
+            reserve_bootmem(0xa0000 - 4096, 4096);
+
 #ifdef CONFIG_SMP
        /*
         * But first pinch a few for the stack/trampoline stuff