From owner-freebsd-questions@FreeBSD.ORG Sun Jan 15 02:19:18 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2830216A41F for ; Sun, 15 Jan 2006 02:19:18 +0000 (GMT) (envelope-from list@mindling.com) Received: from b.mail.sonic.net (b.mail.sonic.net [64.142.19.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC81B43D45 for ; Sun, 15 Jan 2006 02:19:17 +0000 (GMT) (envelope-from list@mindling.com) Received: from [10.0.0.11] (64-142-39-120.dsl.static.sonic.net [64.142.39.120]) (authenticated bits=0) by b.mail.sonic.net (8.13.3/8.13.3) with ESMTP id k0F2JHmr029479 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sat, 14 Jan 2006 18:19:17 -0800 Message-ID: <43C9B125.5040509@mindling.com> Date: Sat, 14 Jan 2006 18:19:17 -0800 From: Sebastian User-Agent: Mozilla Thunderbird 1.0.5 (Windows/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 CC: freebsd References: <43C96C73.9010904@mindling.com> In-Reply-To: <43C96C73.9010904@mindling.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Getting around WRITE_DMA errors X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 02:19:18 -0000 Sebastian wrote: > Hi, > Installing 6.0-RELEASE on a new machine. (Have tried 5.4 too). Using a > PCChips M848ALU motherboard with onboard SiS > IDE controller, and a Hitachi 160gb disk. > > When my disk is in UDMA6 (133) mode, FreeBSD dies painfully with many > errors like: > > ad0: WARNING - WRITE_DMA48 UDMA ICRC error (retrying request) > LBA=316139999 > ad0: WARNING - WRITE_DMA48 UDMA ICRC error (retrying request) > LBA=316139999 > ad0: FAILURE - WRITE_DMA48 status=51(READY,DSC,ERROR) > error=4(ABORTED) LBA=316139999 > > It then panics and dumps: > > panic: initiate_write_inodeblock_ufs2: already started > > If I disable dma using "set hw.ata.ata_dma=0" at boot, or simply boot > in safe mode, it goes into PI04 mode and works fine. Also, if I change > to a lesser UDMA value using atacontrol after boot, such as: > > # atacontrol mode ad0 UDMA4 > > ... it also seems to behave just fine. I've tried UDMA3, UDMA4, UDMA5, > all seemingly without errors. But when I use UDMA6, the machine > immediately dies when the disk gets written to. > > So my question: > > What's the best way to tell FreeBSD to always use UDMA5 mode on that > disk at boot time (before it attempts to use the drive)? So far the best I've come up with is adding to /etc/sysctl.conf: hw.ata.ata_dma=0 And to /etc/rc.d/early.sh: atacontrol mode ad0 UDMA5 Does this seem reasonable? It feels like there should be a better way.