mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin Eriksson" <nitrax@giron.wox.org>
To: "Calin A. Culianu" <calin@ajvar.org>,
	"Petri Kaukasoina" <kaukasoi@elektroni.ee.tut.fi>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH][highly-experimental] via-mwq (Was: Re: VIA acknowledges North Bridge bug...)
Date: Fri, 7 Dec 2001 11:28:47 +0100	[thread overview]
Message-ID: <006d01c17f09$f4d61ab0$0201a8c0@HOMER> (raw)
In-Reply-To: <Pine.LNX.4.30.0112061657150.22686-100000@rtlab.med.cornell.edu>

[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]

----- Original Message -----
From: "Calin A. Culianu" <calin@ajvar.org>
To: "Petri Kaukasoina" <kaukasoi@elektroni.ee.tut.fi>
Cc: <linux-kernel@vger.kernel.org>
Sent: Thursday, December 06, 2001 11:09 PM
Subject: Re: VIA acknowledges North Bridge bug (AKA Linux Kernel with Athlon

> Here is the webpage:
>
> 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, which will supposedly switch off a Memory Write Queue timer.
> In the KT133A datasheet, register 55 is "reserved". But - yikes! - in the
> KT266, the documented MWQ register is register 95, not 55. Register 55
> contains unrelated DDR timing adjustments and could actually be dangerous
> to program. For this reason, I do not recommend installing this driver on
> the KT266x chipsets until VIA examines this issue. For now, use WPCREDIT
> and set bits 5, 6, and 7 to zero in register 95 instead."
>
> ----
>
> Clearly, we need to modify the via workaround patches to take into account
> the other via device id's (namely 3099, 3102, and 3112), and for each one
> change the appropriate register.  Either register 55 or in the case of the
> kt266x, register 95.  I am grepping through quirks.c right now and it
> seems this would be the correct file to modify.. any other suggestions on
> what file to modify?

I've (hastily) put these changes into "arch/i386/kernel/pci-pc.c" and had to
modify "include/linux/pci_ids.h" too.

The patch is included, but a warning: I have no VIA based computer that I
can test this on myself...

_____________________________________________________
|  Martin Eriksson <nitrax@giron.wox.org>
|  MSc CSE student, department of Computing Science
|  Umeå University, Sweden


[-- Attachment #2: via-mwq.patch --]
[-- Type: application/octet-stream, Size: 2693 bytes --]

--- linux-2.4.16/arch/i386/kernel/pci-pc.c	Fri Nov  9 22:58:02 2001
+++ linux-2.4.16-devel/arch/i386/kernel/pci-pc.c	Fri Dec  7 11:00:01 2001
@@ -1109,25 +1109,38 @@
 }
 
 /*
- * Nobody seems to know what this does. Damn.
- *
- * But it does seem to fix some unspecified problem
+ * This does seem to fix some unspecified problem
  * with 'movntq' copies on Athlons.
  *
- * VIA 8363 chipset:
- *  - bit 7 at offset 0x55: Debug (RW)
+ * VIA 8361/8363/8662 chipset:
+ *  - bit 7,6,5 at offset 0x55: Debug (RW)
  */
 static void __init pci_fixup_via_athlon_bug(struct pci_dev *d)
 {
 	u8 v;
 	pci_read_config_byte(d, 0x55, &v);
-	if (v & 0x80) {
-		printk("Trying to stomp on Athlon bug...\n");
-		v &= 0x7f; /* clear bit 55.7 */
+	if (v & 0xE0) {
+		printk("PCI: Disabling VIA VT8361/8363/8662 Memory Write Queue\n");
+		v &= 0x1f; /* clear bit 55.7, 6, 5 */
 		pci_write_config_byte(d, 0x55, v);
 	}
 }
 
+/*
+ * VIA 8366 chipset:
+ *  - bit 7,6,5 at offset 0x95: Debug (RW)
+ */
+static void __init pci_fixup_via_kt266_athlon_bug(struct pci_dev *d)
+{
+	u8 v;
+	pci_read_config_byte(d, 0x95, &v);
+	if (v & 0xE0) {
+		printk("PCI: Disabling VIA VT8366 Memory Write Queue\n");
+		v &= 0x1f; /* clear bit 55.7, 6, 5 */
+		pci_write_config_byte(d, 0x95, v);
+	}
+}
+
 struct pci_fixup pcibios_fixups[] = {
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82451NX,	pci_fixup_i450nx },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82454GX,	pci_fixup_i450gx },
@@ -1138,6 +1151,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_8366_0,	pci_fixup_via_kt266_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8662_0,	pci_fixup_via_athlon_bug },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8361_0,	pci_fixup_via_athlon_bug },
 	{ 0 }
 };
 
--- linux-2.4.16/include/linux/pci_ids.h	Fri Nov  9 23:11:15 2001
+++ linux-2.4.16-devel/include/linux/pci_ids.h	Fri Dec  7 00:25:12 2001
@@ -948,6 +948,9 @@
 #define PCI_DEVICE_ID_VIA_8233_0	0x3074
 #define PCI_DEVICE_ID_VIA_8233C_0	0x3109
 #define PCI_DEVICE_ID_VIA_8633_0	0x3091
+#define PCI_DEVICE_ID_VIA_8366_0	0x3099
+#define PCI_DEVICE_ID_VIA_8662_0	0x3102
+#define PCI_DEVICE_ID_VIA_8361_0	0x3112
 #define PCI_DEVICE_ID_VIA_8367_0	0x3099
 #define PCI_DEVICE_ID_VIA_86C100A	0x6100
 #define PCI_DEVICE_ID_VIA_8231		0x8231

  reply	other threads:[~2001-12-07 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-05 19:21 VIA acknowledges North Bridge bug (AKA Linux Kernel with Athlon optimizations bug) Troels Walsted Hansen
2001-12-05 21:09 ` Calin A. Culianu
2001-12-06  0:41   ` VIA acknowledges North Bridge bug (AKA Linux Kernel with Athlon Alan Cox
2001-12-06  8:45     ` Petri Kaukasoina
2001-12-06 22:09       ` Calin A. Culianu
2001-12-07 10:28         ` Martin Eriksson [this message]
2001-12-07 12:46           ` [PATCH][highly-experimental] via-mwq (Was: Re: VIA acknowledges North Bridge bug...) Pozsar Balazs
2001-12-07 18:45           ` Calin A. Culianu
2001-12-06 21:35     ` VIA acknowledges North Bridge bug (AKA Linux Kernel with Athlon Calin A. Culianu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006d01c17f09$f4d61ab0$0201a8c0@HOMER' \
    --to=nitrax@giron.wox.org \
    --cc=calin@ajvar.org \
    --cc=kaukasoi@elektroni.ee.tut.fi \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome