From owner-svn-src-head@FreeBSD.ORG Thu Sep 2 12:32:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F67A1065769; Thu, 2 Sep 2010 12:32:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ECF68FC14; Thu, 2 Sep 2010 12:32:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o82CWTQO004816; Thu, 2 Sep 2010 12:32:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o82CWTRD004814; Thu, 2 Sep 2010 12:32:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201009021232.o82CWTRD004814@svn.freebsd.org> From: Alexander Motin Date: Thu, 2 Sep 2010 12:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212146 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 12:32:29 -0000 Author: mav Date: Thu Sep 2 12:32:29 2010 New Revision: 212146 URL: http://svn.freebsd.org/changeset/base/212146 Log: Add fix for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in response to DMA activate FIS under certain circumstances. This is recommended fix from chip datasheet. If triggered, this bug most likely cause write command timeout. MFC after: 2 weeks Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Sep 2 11:18:43 2010 (r212145) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Sep 2 12:32:29 2010 (r212146) @@ -365,7 +365,15 @@ ata_sii_status(device_t dev) static void ata_sii_reset(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); + int offset = ((ch->unit & 1) << 7) + ((ch->unit & 2) << 8); + uint32_t val; + + /* Apply R_ERR on DMA activate FIS errata workaround. */ + val = ATA_INL(ctlr->r_res2, 0x14c + offset); + if ((val & 0x3) == 0x1) + ATA_OUTL(ctlr->r_res2, 0x14c + offset, val & ~0x3); if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev);