From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 29 11:17:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2A7916A4CE for ; Fri, 29 Oct 2004 11:17:41 +0000 (GMT) Received: from tx5.mail.ox.ac.uk (tx5.mail.ox.ac.uk [163.1.2.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4A1743D55 for ; Fri, 29 Oct 2004 11:17:40 +0000 (GMT) (envelope-from neil.hoggarth@physiol.ox.ac.uk) Received: from scan5.mail.ox.ac.uk ([163.1.2.177] helo=localhost) by tx5.mail.ox.ac.uk with esmtp (Exim 4.42) id 1CNUlH-0000zc-I3 for freebsd-hackers@freebsd.org; Fri, 29 Oct 2004 12:17:39 +0100 Received: from rx5.mail.ox.ac.uk ([163.1.2.168]) by localhost (scan5.mail.ox.ac.uk [163.1.2.177]) (amavisd-new, port 25) with ESMTP id 03432-01 for ; Fri, 29 Oct 2004 12:17:39 +0100 (BST) Received: from wren.physiol.ox.ac.uk ([163.1.249.100] helo=mail.physiol.ox.ac.uk) by rx5.mail.ox.ac.uk with esmtp (Exim 4.42) id 1CNUlG-0000zE-JA; Fri, 29 Oct 2004 12:17:38 +0100 Received: from saros.physiol (saros.physiol [163.1.249.131]) i9TBHcpX011312; Fri, 29 Oct 2004 12:17:38 +0100 (BST) Date: Fri, 29 Oct 2004 12:17:35 +0100 (BST) From: Neil Hoggarth X-X-Sender: njh@saros.physiol To: freebsd-hackers@freebsd.org In-Reply-To: <4168F9E7.9040408@DeepCore.dk> Message-ID: References: <200410081937.15068.miha@ghuug.org> <41682D3F.4060902@DeepCore.dk> <200410091843.06854.miha@ghuug.org> <4168F9E7.9040408@DeepCore.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Mailman-Approved-At: Fri, 29 Oct 2004 12:22:01 +0000 cc: =?iso-8859-1?Q?S=F8ren_Schmidt?= Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 11:17:41 -0000 On 8th October, Mikhail P. reported the error: ad0: FAILURE - WRITE_DMA status=3D51 error=3D10 LBA=3D268435455 On Sun, 10 Oct 2004, S=F8ren Schmidt wrote: > so that leaves the disks for scrutiny. One thing to try is change the > tripping point where we switch from 28bit mode to 48 bit mode, could be > a 1 off error in the firmware... This sounds very possible to me. I have been experiencing the same error, on a system that I've been trying to set up using 5.3-RC1 and a new 160Gbyte SATA drives My hardware is: atapci0: port 0xb000-0xb00f,0xac00-0xac03,0xa= 800-0xa807,0xa400-0xa403,0xa000-0xa007 mem 0xdf081000-0xdf0811ff irq 18 at = device 11.0 on pci1 ad4: 152627MB [310101/16/63] at ata2-master SATA150 (I notice that Michail and I both have Seagate drives ...). I had problems with a filesystem on a partition which crossed the LBA=3D268435455 threshold. After googling and reading this thread and S=F8ren's posting, I tried removing the filesystem and making a little 1000 sector partition which straddled the lba48 transition sector - I was able to get read and write failure messages of the above form reproducibly, by dd-ing between the test partition and /dev/zero. I edited the /usr/src/sys/dev/ata/ata-lowlevel.c file and reduced the 48-bit trigger level by one: --- ata-lowlevel.c.orig Fri Oct 29 12:06:09 2004 +++ ata-lowlevel.c Fri Oct 29 12:05:38 2004 @@ -700,7 +700,7 @@ ATA_IDX_OUTB(atadev->channel, ATA_ALTSTAT, ATA_A_4BIT); /* only use 48bit addressing if needed (avoid bugs and overhead) */ - if ((lba > 268435455 || count > 256) && atadev->param && + if ((lba > 268435454 || count > 256) && atadev->param && atadev->param->support.command2 & ATA_SUPPORT_ADDRESS48) { /* translate command into 48bit version */ and built a new kernel (I'm using the stock GENERIC configuration). The resulting kernel was able to dd to and from the test partition without error. I've now created a new filesystem that uses this part of the disk and restored the contents from backup, and have been actively using the filesystem for the last day without observing any further problems. Regards, --=20 Neil Hoggarth Departmental Computing Manager Laboratory of Physiology http://www.physiol.ox.ac.uk/~njh/ University of Oxford, UK