Panic on boot with today's CURRENT, ata related

Nate Lawson nate at root.org
Fri Aug 6 13:33:56 PDT 2004


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
-------------- next part --------------
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;


More information about the freebsd-current mailing list