Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Dec 2001 10:45:01 +0100 (CET)
From:      Søren Schmidt <sos@freebsd.dk>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Matthew Gilbert <agilbertm@earthlink.net>, freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: 4.4-STABLE crashes - suspects new ata-driver over wd-drivers
Message-ID:  <200112270945.fBR9j1e97273@freebsd.dk>
In-Reply-To: <200112262355.fBQNtfK48250@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
It seems Matthew Dillon wrote:
>     Soren, if you post a patch for 4.x I will be happy to follow-up 
>     with Brady.  I've been working with Brady for several days now trying 
>     to track down corruption in the vm_page array.  I *really* want to know
>     if a VIA chipset patch solves his problem, because it would
>     also explain about a dozen similar bug reports over the last 6 months.
>     (Which would also be good backing to get it into 4.5).

OK, here goes the VIA 686b patch, it is hand cut out from the bulk patches
to go into 4.5 so beware :)

Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.50.2.27
diff -u -r1.50.2.27 ata-all.c
--- ata-all.c	22 Dec 2001 19:12:18 -0000	1.50.2.27
+++ ata-all.c	25 Dec 2001 14:21:31 -0000
@@ -240,6 +235,30 @@
     return 0;
 }
 
+static void
+ata_via686b(device_t dev)
+{
+    device_t *children, child;
+    int nchildren, i;
+
+    if (device_get_children(device_get_parent(dev), &children, &nchildren))
+	return;
+
+    for (i = 0; i < nchildren; i++) {
+	child = children[i];
+
+	if (pci_get_devid(child) == 0x03051106 ||	/* VIA KT133 */
+	    pci_get_devid(child) == 0x03911106) {	/* VIA KX133 */
+	    pci_write_config(child, 0x75, 0x83, 1);
+	    pci_write_config(child, 0x76, 
+	    		     (pci_read_config(child, 0x76, 1) & 0xdf) | 0xd0,1);
+	    device_printf(dev, "VIA '686b southbridge fix applied\n");
+	    break;
+	}
+    }
+    free(children, M_TEMP);
+}
+
 static const char *
 ata_pci_match(device_t dev)
 {
@@ -474,9 +519,24 @@
 	}
 	break;
 
-    case 0x05711106:
-    case 0x74111022:
-    case 0x74091022: /* VIA 82C586, '596, '686 & AMD 756, 766 default setup */
+    case 0x05711106: /* VIA 82C586, '596, '686 default setup */
+	
+	/* prepare for ATA-66 on the 82C686a and rev 0x12 and newer 82C596's */
+	if ((ata_find_dev(dev, 0x06861106, 0) &&
+	     !ata_find_dev(dev, 0x06861106, 0x40)) ||
+	    ata_find_dev(dev, 0x05961106, 0x12)) {
+	    pci_write_config(dev, 0x50, 
+			     pci_read_config(dev, 0x50, 4) | 0x030b030b, 4);   
+	}
+
+	/* the '686b might need the data corruption fix */
+	if (ata_find_dev(dev, 0x06861106, 0x40))
+	    ata_via686b(dev);
+
+	/* FALLTHROUGH */
+
+    case 0x74091022: /* AMD 756 default setup */
+    case 0x74111022: /* AMD 766 default setup */
 
 	/* set prefetch, postwrite */
 	pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1);
@@ -495,14 +555,6 @@
 	/* set sector size */
 	pci_write_config(dev, 0x60, DEV_BSIZE, 2);
 	pci_write_config(dev, 0x68, DEV_BSIZE, 2);
-	
-	/* prepare for ATA-66 on the 82C686a and rev 0x12 and newer 82C596's */
-	if ((ata_find_dev(dev, 0x06861106, 0) &&
-	     !ata_find_dev(dev, 0x06861106, 0x40)) ||
-	    ata_find_dev(dev, 0x05961106, 0x12)) {
-	    pci_write_config(dev, 0x50, 
-			     pci_read_config(dev, 0x50, 4) | 0x030b030b, 4);   
-	}
 	break;
 
     case 0x10001042:	/* RZ 100? known bad, no DMA */

-Søren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112270945.fBR9j1e97273>