From owner-freebsd-current Tue Dec 21 13:51:22 1999 Delivered-To: freebsd-current@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id 6D44715521 for ; Tue, 21 Dec 1999 13:51:17 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 977C71CCE; Wed, 22 Dec 1999 05:51:14 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.1.1 10/15/1999 To: Theo van Klaveren Cc: freebsd-current@freebsd.org Subject: Re: Problems with the ATA-driver In-Reply-To: Message from Theo van Klaveren of "Tue, 21 Dec 1999 15:42:44 +0100." Date: Wed, 22 Dec 1999 05:51:14 +0800 From: Peter Wemm Message-Id: <19991221215114.977C71CCE@overcee.netplex.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Theo van Klaveren wrote: > > When installing the 08-dec-1999 snapshot (before ATA went in GENERIC), > a recompile from the kernel with the ATA driver instead of the WD > driver resulted in an unbootable system because of the following > error (approx.): > > mounting root /dev/ad0s1a > ata-master: lost disk contact > ata: resetting devices .. > > After this, the machine hangs and doesn't respond to anything but a push > on the Big Red Button. A few days later, this was fixed by Soren (sp?) but > it broke again as I recompiled my system yesterday (This was the first > time after it had been fixed, so I don't know when exactly it broke). > > Harddisks: Western Digital Caviar (2.0 GB), non-DMA and > Western Digital Caviar (2.5 GB), DMA-33. > Mainboard: Asus P5A-B Super7 > Chipset: ALi Aladdin V AGPset > > Taking the UDMA disk out doesn't help. Everything works just > fine with the WD driver... Same here, but with a toshiba laptop disk. I have to comment out a version test in ata-disk.c to get it to work. --- ata-disk.c 1999/12/18 20:06:30 1.46 +++ ata-disk.c 1999/12/21 21:48:28 @@ -117,7 +117,7 @@ static __inline int udmamode(struct ata_params *ap) { - if ((ap->atavalid & 4) && ad_version(ap->versmajor) >= 3) { + if ((ap->atavalid & 4) /* && ad_version(ap->versmajor) >= 3 */) { if (ap->udmamodes & 0x10) return (ap->cblid ? 4 : 2); if (ap->udmamodes & 0x08) return (ap->cblid ? 3 : 2); if (ap->udmamodes & 0x04) return 2; Without this, ata thinks is's an ATA-0 disk and tries to use DMA mode. However, it hangs with: mounting root /dev/ad0s1a ata-master: lost disk contact ata: resetting devices .. and never gets to "done" just like you. If I remove the ATA version test and just have it look at the "I support UDMA" bit, it runs in UDMA33 mode and works fine. I suspect that if it got a CRC error and tried to do a fallback that it would hang there too, but I have not seen any. I think the (plain) DMA code is broken somewhere. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message