From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 1 18:03:24 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81E5916A400 for ; Sun, 1 Jul 2007 18:03:24 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from mother.ludd.ltu.se (mother.ludd.ltu.se [130.240.16.3]) by mx1.freebsd.org (Postfix) with ESMTP id 118DE13C447 for ; Sun, 1 Jul 2007 18:03:23 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from brother.ludd.ltu.se (root@brother.ludd.ltu.se [130.240.16.78]) by mother.ludd.ltu.se (8.13.6+Sun/8.12.10) with ESMTP id l61I3LRb014530; Sun, 1 Jul 2007 20:03:21 +0200 (MEST) Received: from brother.ludd.ltu.se (pb@localhost [127.0.0.1]) by brother.ludd.ltu.se (8.13.6+Sun/8.12.2) with ESMTP id l61I3LM9010285; Sun, 1 Jul 2007 20:03:21 +0200 (MEST) Received: (from pb@localhost) by brother.ludd.ltu.se (8.13.6+Sun/8.13.6/Submit) id l61I3KbA010283; Sun, 1 Jul 2007 20:03:20 +0200 (MEST) From: Peter B Message-Id: <200707011803.l61I3KbA010283@brother.ludd.ltu.se> To: freebsd@sopwith.solgatos.com (Dieter) Date: Sun, 1 Jul 2007 20:03:20 +0200 (MEST) In-Reply-To: <200707011601.QAA29911@sopwith.solgatos.com> from "Dieter" at Jul 01, 2007 09:01:29 AM X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sun, 01 Jul 2007 18:40:16 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: SII3512 rev0 ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2007 18:03:24 -0000 >NetBSD: > dev/pci/satalink.c > > /* > * Rev. <= 0x01 of the 3112 have a bug that can cause data > * corruption if DMA transfers cross an 8K boundary. This is > * apparently hard to tickle, but we'll go ahead and play it > * safe. > */ > if (PCI_REVISION(pa->pa_class) <= 0x01) { > sc->sc_dma_maxsegsz = 8192; > sc->sc_dma_boundary = 8192; > >FreeBSD: > dev/ata/ata-chipset.c > > if ((ctlr->chip->cfg2 & SIIBUG) && ch->dma) { > /* work around errata in early chips */ > ch->dma->boundary = 16 * DEV_BSIZE; > ch->dma->segsize = 15 * DEV_BSIZE; DEV_BSIZE = (1<<9) = 512 bytes boundary = 8192 segsize = 7680 <- Differs by 512 bytes from NetBSD.. Anyone knows why segsize differs? >And of course there may be other differences I didn't find. The table used to parse pci setup: {{ ATA_SII3114, 0x00, SIIMEMIO, SII4CH, ATA_SA150, "SiI 3114" }, { ATA_SII3512, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3512" }, { ATA_SII3112, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" }, { ATA_SII3112_1, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" }, { ATA_SII3512, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3512" }, { ATA_SII3112, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" }, { ATA_SII3112_1, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" }, { ATA_SII3124, 0x00, SIIPRBIO, SII4CH, ATA_SA300, "SiI 3124" }, { ATA_SII3132, 0x00, SIIPRBIO, 0, ATA_SA300, "SiI 3132" }, And it's parsed with this conditional: pci_get_revid(dev) >= index->chiprev /* ata_match_chip() */ So for 3112 rev 0,1 SIIBUG will be enabled on FreeBSD-curr. Ie same behaviour as for when to apply the fix. This hw seems to be like russian roulette ;) Maybe it would be a good idea to have chip revision displayed in the syslog such that an sysadm can quickly spot possible troublesome hw.. In ata_sii_ident() replace: sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma)); With something along the lines of: int chiprev; chiprev = (int)pci_get_revid(dev); /* assumed unfailable :) */ sprintf(buffer, "%s rev %d %s controller", idx->text, chiprev, ata_mode2str(idx->max_dma) ); /P