From owner-freebsd-current@FreeBSD.ORG Thu Sep 18 06:54:49 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8904C16A4BF for ; Thu, 18 Sep 2003 06:54:49 -0700 (PDT) Received: from spider.deepcore.dk (cpe.atm2-0-56339.0x50c6aa0a.abnxx2.customer.tele.dk [80.198.170.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43A8F43FE0 for ; Thu, 18 Sep 2003 06:54:46 -0700 (PDT) (envelope-from sos@spider.deepcore.dk) Received: from spider.deepcore.dk (localhost [127.0.0.1]) by spider.deepcore.dk (8.12.9/8.12.9) with ESMTP id h8IDsaj5023909; Thu, 18 Sep 2003 15:54:36 +0200 (CEST) (envelope-from sos@spider.deepcore.dk) Received: (from sos@localhost) by spider.deepcore.dk (8.12.9/8.12.9/Submit) id h8IDsa0F023908; Thu, 18 Sep 2003 15:54:36 +0200 (CEST) From: Soren Schmidt Message-Id: <200309181354.h8IDsa0F023908@spider.deepcore.dk> In-Reply-To: <20030918134850.GA22643@student.agh.edu.pl> To: w@dream.vg Date: Thu, 18 Sep 2003 15:54:36 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL99f (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 X-mail-scanned: by DeepCore Virus & Spam killer v1.3 cc: freebsd-current@FreeBSD.ORG Subject: Re: ATAng still problematic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 13:54:49 -0000 It seems Jan Srzednicki wrote: > First of all, the drive still does not get detected properly. Funny > thing is that after some playing with atacontrol attach/detach, it > finally gets detected. And later on, it is normally detected, before. > Same scenario happened like 3 times with ATAng and newer and newer > kernels. I don't know whether some device hints or anything are just > updated; yet, I didn't have _any_ drive detection problems with ATAold. > > The problem is with the second drive. There's still some randomness in > it, as it gets undetected from time to time. Try the below patch and let me know if that changes anything.. Index: ata-lowlevel.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v retrieving revision 1.13 diff -u -r1.13 ata-lowlevel.c --- ata-lowlevel.c 16 Sep 2003 15:21:37 -0000 1.13 +++ ata-lowlevel.c 18 Sep 2003 07:55:10 -0000 @@ -551,11 +551,8 @@ ch->devices |= ATA_ATA_MASTER; } } - else if (err == lsb && err == msb) { - ATA_IDX_OUTB(ch, ATA_ERROR, 0xff); - DELAY(10); - if (stat0 == ATA_IDX_INB(ch, ATA_STATUS)) - stat0 |= ATA_S_BUSY; + else if ((stat0 & 0x4f) && err == lsb && err == msb) { + stat0 |= ATA_S_BUSY; } } } @@ -579,11 +576,8 @@ ch->devices |= ATA_ATA_SLAVE; } } - else if (err == lsb && err == msb) { - ATA_IDX_OUTB(ch, ATA_ERROR, 0xff); - DELAY(10); - if (stat1 == ATA_IDX_INB(ch, ATA_STATUS)) - stat1 |= ATA_S_BUSY; + else if ((stat1 & 0x4f) && err == lsb && err == msb) { + stat1 |= ATA_S_BUSY; } } } -Søren