Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2003 19:28:04 +0100 (CET)
From:      Soren Schmidt <sos@spider.deepcore.dk>
To:        Joe Marcus Clarke <marcus@marcuscom.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Recent ATA drivers giving problems with SATA
Message-ID:  <200311261828.hAQIS4k3021746@spider.deepcore.dk>
In-Reply-To: <1069870507.752.18.camel@gyros>

next in thread | previous in thread | raw e-mail | index | archive | help
It seems Joe Marcus Clarke wrote:
> atapci1: <SiI 3112 SATA150 controller> port
> 0x14b0-0x14bf,0x14c0-0x14c3,0x14c8-0x14cf,0x14c4-0x14c7,0x14d0-0x14d7
> mem 0xe800a000-0xe800a1ff irq 9 at device 16.0 on pci0
> GEOM: create disk ad4 dp=0xc5246460
> ad4: 78167MB <Maxtor 6Y080M0> [158816/16/63] at ata2-master UDMA133
> 
> Nothing else was changed in the machine except the specific version of
> -CURRENT since the time things worked and now.  In addition to replacing
> the drive, I have replaced the SATA cable as well.  My plan is to revert
> the ATA drivers to two weeks ago, and see if the problem persists. 
> Failing that, I will test to see if this is a cooling problem.  Failing
> that, I will replace the SATA controller.  However, I wanted to know if
> I'm barking up the wrong tree, and perhaps this is a software issue. 

There are some early issues of the SiI3112 chips that has problems that
can cause datacorruption etc etc..
You can try the following patch (which btw re@ has for approval), 
otherwise I'd try another controller as there seem to be no end of the
troubles with the Sii 3112 chips (brings back to mind the horror times
from when they where called CMD and did the CMD640 disaster)...

Index: ata-all.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.h,v
retrieving revision 1.67
diff -u -r1.67 ata-all.h
--- ata-all.h	11 Nov 2003 14:55:35 -0000	1.67
+++ ata-all.h	22 Nov 2003 20:53:40 -0000
@@ -246,6 +246,7 @@
     struct ata_dmaentry		*dmatab;	/* DMA transfer table */
     bus_addr_t			mdmatab;	/* bus address of dmatab */
     u_int32_t			alignment;	/* DMA engine alignment */
+    u_int32_t			boundary;	/* DMA engine boundary */
     u_int32_t			max_iosize;	/* DMA engine max IO size */
     u_int32_t			cur_iosize;	/* DMA engine current IO size */
     int				flags;
Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.47
diff -u -r1.47 ata-chipset.c
--- ata-chipset.c	21 Nov 2003 22:58:56 -0000	1.47
+++ ata-chipset.c	22 Nov 2003 20:50:42 -0000
@@ -1576,8 +1576,10 @@
     struct ata_pci_controller *ctlr = device_get_softc(dev);
     struct ata_chip_id *idx;
     static struct ata_chip_id ids[] =
-    {{ ATA_SII3112,   0x00, SIIMEMIO, 0,	 ATA_SA150, "SiI 3112" },
-     { ATA_SII3112_1, 0x00, SIIMEMIO, 0,	 ATA_SA150, "SiI 3112" },
+    {{ ATA_SII3112,   0x02, SIIMEMIO, 0,	 ATA_SA150, "SiI 3112" },
+     { ATA_SII3112_1, 0x02, SIIMEMIO, 0,	 ATA_SA150, "SiI 3112" },
+     { ATA_SII3112,   0x00, SIIMEMIO, SIIBUG,	 ATA_SA150, "SiI 3112" },
+     { ATA_SII3112_1, 0x00, SIIMEMIO, SIIBUG,	 ATA_SA150, "SiI 3112" },
      { ATA_SII0680,   0x00, SIIMEMIO, SIISETCLK, ATA_UDMA6, "SiI 0680" },
      { ATA_CMD649,    0x00, 0,	      SIIINTR,   ATA_UDMA5, "CMD 649" },
      { ATA_CMD648,    0x00, 0,	      SIIINTR,   ATA_UDMA4, "CMD 648" },
@@ -1684,6 +1686,8 @@
     if (ctlr->chip->max_dma >= ATA_SA150)
 	ch->flags |= ATA_NO_SLAVE;
     ctlr->dmainit(ch);
+    if (ctlr->chip->cfg2 & SIIBUG)
+	ch->dma->boundary = 8 * 1024;
     return 0;
 }
 
Index: ata-dma.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-dma.c,v
retrieving revision 1.122
diff -u -r1.122 ata-dma.c
--- ata-dma.c	21 Oct 2003 19:20:37 -0000	1.122
+++ ata-dma.c	22 Nov 2003 20:51:07 -0000
@@ -74,7 +74,8 @@
 	ch->dma->load = ata_dmaload;
 	ch->dma->unload = ata_dmaunload;
 	ch->dma->alignment = 2;
-	ch->dma->max_iosize = 64*1024;
+	ch->dma->max_iosize = 64 * 1024;
+	ch->dma->boundary = 64 * 1024;
     }
 }
 
@@ -106,9 +107,10 @@
 			   BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->cdmatag))
 	goto error;
 
-    if (bus_dma_tag_create(ch->dma->dmatag, ch->dma->alignment, 64*1024,
+    if (bus_dma_tag_create(ch->dma->dmatag,ch->dma->alignment,ch->dma->boundary,
 			   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR,
-			   NULL, NULL, MAXPHYS, ATA_DMA_ENTRIES, MAXSEGSZ,
+			   NULL, NULL, ch->dma->max_iosize, 
+			   ATA_DMA_ENTRIES, ch->dma->boundary,
 			   BUS_DMA_ALLOCNOW, NULL, NULL, &ch->dma->ddmatag))
 	goto error;
 
Index: ata-pci.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v
retrieving revision 1.18
diff -u -r1.18 ata-pci.h
--- ata-pci.h	18 Nov 2003 15:27:28 -0000	1.18
+++ ata-pci.h	21 Nov 2003 23:06:24 -0000
@@ -255,6 +255,7 @@
 #define SIIMEMIO	1
 #define SIIINTR		0x01
 #define SIISETCLK	0x02
+#define SIIBUG		0x04
 
 #define SIS_SOUTH	1
 #define SISSATA		2

-Søren



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