Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Aug 2004 13:33:46 -0700
From:      Nate Lawson <nate@root.org>
To:        Radek Kozlowski <radek@raadradd.com>, Ceri Davies <ceri@submonkey.net>
Cc:        sos@deepcore.dk
Subject:   Re: Panic on boot with today's CURRENT, ata related
Message-ID:  <4113EB2A.7060401@root.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030405010909090504040801
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I took a quick look at this ATA panic.  The exact same one occurs for 
Ceri.  A quick dissassemble shows that the testb is the check for the 
DMA flag at the very end of ata_generic_transaction().  The bug appears 
to be that this may be a PIO request (since the DMA check is outside the 
switch() statement).  The fix is to make sure it's a DMA request before 
dereferencing an element of the DMA struct.  Try the attached patch.

-Nate

--------------030405010909090504040801
Content-Type: text/plain;
 name="ata-dmafix.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ata-dmafix.diff"

Index: ata-lowlevel.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v
retrieving revision 1.40
diff -u -r1.40 ata-lowlevel.c
--- ata-lowlevel.c	24 Jul 2004 19:03:28 -0000	1.40
+++ ata-lowlevel.c	6 Aug 2004 20:28:15 -0000
@@ -294,7 +294,7 @@
     }
 
     /* request finish here */
-    if (ch->dma->flags & ATA_DMA_ACTIVE)
+    if ((request->flags & ATA_R_DMA) && ch->dma->flags & ATA_DMA_ACTIVE)
 	ch->dma->unload(ch);
     ch->running = NULL;
     return ATA_OP_FINISHED;

--------------030405010909090504040801--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4113EB2A.7060401>