From owner-freebsd-current@FreeBSD.ORG Wed Nov 26 10:30:50 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D137E16A4CF for ; Wed, 26 Nov 2003 10:30:50 -0800 (PST) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B46A43FE3 for ; Wed, 26 Nov 2003 10:30:47 -0800 (PST) (envelope-from sos@spider.deepcore.dk) Received: from spider.deepcore.dk (localhost [127.0.0.1]) by spider.deepcore.dk (8.12.10/8.12.10) with ESMTP id hAQIS5EQ021747; Wed, 26 Nov 2003 19:28:05 +0100 (CET) (envelope-from sos@spider.deepcore.dk) Received: (from sos@localhost) by spider.deepcore.dk (8.12.10/8.12.10/Submit) id hAQIS4k3021746; Wed, 26 Nov 2003 19:28:04 +0100 (CET) (envelope-from sos) From: Soren Schmidt Message-Id: <200311261828.hAQIS4k3021746@spider.deepcore.dk> In-Reply-To: <1069870507.752.18.camel@gyros> To: Joe Marcus Clarke Date: Wed, 26 Nov 2003 19:28:04 +0100 (CET) X-Mailer: ELM [version 2.4ME+ PL99f (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 X-mail-scanned: by DeepCore Virus & Spam killer v1.3 cc: current@FreeBSD.ORG Subject: Re: Recent ATA drivers giving problems with SATA X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2003 18:30:51 -0000 It seems Joe Marcus Clarke wrote: > atapci1: 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 [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