From owner-freebsd-current@FreeBSD.ORG Thu Oct 9 01:02:19 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 3F5BE16A4B3; Thu, 9 Oct 2003 01:02:19 -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 1F97C43FFB; Thu, 9 Oct 2003 01:02:16 -0700 (PDT) (envelope-from sos@spider.deepcore.dk) Received: from spider.deepcore.dk (localhost [127.0.0.1]) by spider.deepcore.dk (8.12.10/8.12.10) with ESMTP id h9981rpN054435; Thu, 9 Oct 2003 10:01:53 +0200 (CEST) (envelope-from sos@spider.deepcore.dk) Received: (from sos@localhost) by spider.deepcore.dk (8.12.10/8.12.10/Submit) id h9981rgV054434; Thu, 9 Oct 2003 10:01:53 +0200 (CEST) (envelope-from sos) From: Soren Schmidt Message-Id: <200310090801.h9981rgV054434@spider.deepcore.dk> In-Reply-To: <3F8492DD.9000407@t-online.de> To: Daniel Rock Date: Thu, 9 Oct 2003 10:01:53 +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: current@FreeBSD.ORG cc: Andrew Gallatin cc: sos@FreeBSD.ORG Subject: Re: UDMA33 on older acer aladdin chips 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, 09 Oct 2003 08:02:19 -0000 It seems Daniel Rock wrote: > > I recently decided to update my alpha UP1000 to today's current from a > > mid-July build. However, UDMA33 did not work on a hard disk attached > > to the built-in Acer Aladdin controller (verbose dmesg appended). > > > > I think I have narrowed the problem down to this line of code: > > > > atadev->channel->flags |= ATA_ATAPI_DMA_RO; > > > > Removing this line gets my UDMA33 back. > > If I understand the code correctly, the right fix should more look like: > > diff -u -r1.18 ata-lowlevel.c > --- ata-lowlevel.c 7 Oct 2003 13:45:56 -0000 1.18 > +++ ata-lowlevel.c 8 Oct 2003 22:38:15 -0000 > @@ -73,7 +73,8 @@ > request->device->channel->running = request; > > /* disable ATAPI DMA writes if HW doesn't support it */ > - if (request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE) && > + if (((request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE)) == > + (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE)) && > request->device->channel->flags & ATA_ATAPI_DMA_RO) > request->flags &= ~ATA_R_DMA; Yep, thats close, I have a patch out for testing that looks semilar, if you can confirm it works, I'll commit it asap: And yes pointy hat to me :) Index: ata-lowlevel.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v retrieving revision 1.18 diff -u -r1.18 ata-lowlevel.c --- ata-lowlevel.c 7 Oct 2003 13:45:56 -0000 1.18 +++ ata-lowlevel.c 9 Oct 2003 06:32:14 -0000 @@ -73,8 +73,9 @@ request->device->channel->running = request; /* disable ATAPI DMA writes if HW doesn't support it */ - if (request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE) && - request->device->channel->flags & ATA_ATAPI_DMA_RO) + if ((request->device->channel->flags & ATA_ATAPI_DMA_RO) && + ((request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE)) == + (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE))) request->flags &= ~ATA_R_DMA; switch (request->flags & (ATA_R_ATAPI | ATA_R_DMA)) { -Søren