All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Athlon bug stomper UPDATE (as per VIA's Windows patch)
@ 2001-12-07 19:00 Calin A. Culianu
  2001-12-07 22:28 ` Aaron Tiensivu
  0 siblings, 1 reply; 2+ messages in thread
From: Calin A. Culianu @ 2001-12-07 19:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, alan

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1315 bytes --]


This patch detects the 0305, 3099, 3102, and 3112 (KT133x, KT266x, VT8662,
and KLE133) *only*. On these chipsets, it will patch register 55 in the
Northbridge and turn off bits: 5, 6, AND 7.  (It does this to register 95
on the KT266x Northbridge). This will supposedly switch off a Memory Write
Queue timer, which can cause those infinite loop bugs and other assorted
crashes.  This patch works just like a similar patch that VIA recently
released for Windows machines.


The difference between this patch and the original athlon bug stomper is
that it is expanded to recognize more chipsets and also does a special
case for the KT266x chipset.

The attached patch is similar to one already submitted to the mailing
list, except I think it's a bit more elegant as it doesn't create a whole
new function for stomping the kt266 register 95, but rather instead used
the existing athlon bug stomper function in pci-pc.c and simply overloads
its functionality. (More efficient in that it has fewer lines and less
generated binary code).


I tested this patch on my KT266 motherboard and it seems to work
correctly.  Essentially no harm can be done by this patch, as most of the
time those registers have those bits turned off anyway.  Only some BIOS's
set those bits incorrectly and thus can cause problems.

-Calin



[-- Attachment #2: Type: TEXT/PLAIN, Size: 418 bytes --]

This patch detects the 0305, 3099, 3102, and 3112 (KT133x, KT266x, VT8662,
and KLE133) *only*. On these chipsets, it will patch register 55 in the
Northbridge and turn off bits: 5, 6, AND 7.  (It does this to register 95
on the KT266x Northbridge). This will supposedly switch off a Memory Write
Queue timer, which can cause those infinite loop bugs and other assorted
crashes.

Calin Culianu
calin@rtlab.org

[-- Attachment #3: The athlong bug stomper patch --]
[-- Type: TEXT/PLAIN, Size: 2923 bytes --]

diff -u -r vanilla/arch/i386/kernel/pci-pc.c patched/arch/i386/kernel/pci-pc.c
--- vanilla/arch/i386/kernel/pci-pc.c	Fri Nov  9 16:58:02 2001
+++ patched/arch/i386/kernel/pci-pc.c	Thu Dec  6 19:03:03 2001
@@ -1114,17 +1114,26 @@
  * But it does seem to fix some unspecified problem
  * with 'movntq' copies on Athlons.
  *
- * VIA 8363 chipset:
- *  - bit 7 at offset 0x55: Debug (RW)
+ * VIA 8363,8622,8361 Northbridges:
+ *  - bits  5, 6, 7 at offset 0x55 need to be turned off
+ * VIA 8367 (KT266x) Northbridges:
+ *  - bits  5, 6, 7 at offset 0x95 need to be turned off
  */
 static void __init pci_fixup_via_athlon_bug(struct pci_dev *d)
 {
 	u8 v;
-	pci_read_config_byte(d, 0x55, &v);
-	if (v & 0x80) {
+	int where = 0x55;
+
+	if (d->device == PCI_DEVICE_ID_VIA_8367_0) {
+  	        where = 0x95; /* the memory write queue timer register is 
+                                 different for the kt266x's: 0x95 not 0x55 */
+	}
+
+        pci_read_config_byte(d, where, &v);
+	if (v & 0xe0) {
 		printk("Trying to stomp on Athlon bug...\n");
-		v &= 0x7f; /* clear bit 55.7 */
-		pci_write_config_byte(d, 0x55, v);
+		v &= 0x1f; /* clear bits 5, 6, 7 */
+		pci_write_config_byte(d, where, v);
 	}
 }
 
@@ -1138,6 +1147,9 @@
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5598,		pci_fixup_latency },
  	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82371AB_3,	pci_fixup_piix4_acpi },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8363_0,	pci_fixup_via_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8622,	        pci_fixup_via_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361,	        pci_fixup_via_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8367_0,	pci_fixup_via_athlon_bug },
 	{ 0 }
 };
 
diff -u -r vanilla/include/linux/pci_ids.h patched/include/linux/pci_ids.h
--- vanilla/include/linux/pci_ids.h	Fri Nov  9 17:11:15 2001
+++ patched/include/linux/pci_ids.h	Thu Dec  6 19:00:57 2001
@@ -912,7 +912,7 @@
 #define PCI_DEVICE_ID_TTI_HPT366	0x0004
 
 #define PCI_VENDOR_ID_VIA		0x1106
-#define PCI_DEVICE_ID_VIA_8363_0	0x0305
+#define PCI_DEVICE_ID_VIA_8363_0	0x0305 
 #define PCI_DEVICE_ID_VIA_8371_0	0x0391
 #define PCI_DEVICE_ID_VIA_8501_0	0x0501
 #define PCI_DEVICE_ID_VIA_82C505	0x0505
@@ -946,9 +946,11 @@
 #define PCI_DEVICE_ID_VIA_8233_7	0x3065
 #define PCI_DEVICE_ID_VIA_82C686_6	0x3068
 #define PCI_DEVICE_ID_VIA_8233_0	0x3074
+#define PCI_DEVICE_ID_VIA_8622          0x3102 
 #define PCI_DEVICE_ID_VIA_8233C_0	0x3109
+#define PCI_DEVICE_ID_VIA_8361          0x3112 
 #define PCI_DEVICE_ID_VIA_8633_0	0x3091
-#define PCI_DEVICE_ID_VIA_8367_0	0x3099
+#define PCI_DEVICE_ID_VIA_8367_0	0x3099 
 #define PCI_DEVICE_ID_VIA_86C100A	0x6100
 #define PCI_DEVICE_ID_VIA_8231		0x8231
 #define PCI_DEVICE_ID_VIA_8231_4	0x8235

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Athlon bug stomper UPDATE (as per VIA's Windows patch)
  2001-12-07 19:00 [PATCH] Athlon bug stomper UPDATE (as per VIA's Windows patch) Calin A. Culianu
@ 2001-12-07 22:28 ` Aaron Tiensivu
  0 siblings, 0 replies; 2+ messages in thread
From: Aaron Tiensivu @ 2001-12-07 22:28 UTC (permalink / raw)
  To: linux-kernel

> The difference between this patch and the original athlon bug stomper is
> that it is expanded to recognize more chipsets and also does a special
> case for the KT266x chipset.

It really really shouldn't be called Athon bug stomper anymore.. if anything
it should be called Via bug stomper.. it's not the fault of teh Athlon that
Via can't make a stable chipset. :) [very tongue in cheek]




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-07 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 19:00 [PATCH] Athlon bug stomper UPDATE (as per VIA's Windows patch) Calin A. Culianu
2001-12-07 22:28 ` Aaron Tiensivu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.