cvs commit: src/sys/dev/ata ata-all.c ata-all.h ata-chipset.c ata-disk.c ata-dma.c ata-lowlevel.c ata-pci.c ata-queue.c ata-raid.c atapi-cam.c atapi-cd.c atapi-fd.c atapi-tape.c

Andrey V. Elsukov bu7cher at yandex.ru
Tue Jun 3 09:54:33 UTC 2008


Fabian Keil wrote:
> With this commit, I'm getting a page fault in bus_dmamap_load()
> reached through ata_dmaload(), right after ad1 is detected:
> http://www.fabiankeil.de/tmp/freebsd/ata-bus-dmamap-load-page-fault-600x383.jpg
> http://www.fabiankeil.de/tmp/freebsd/ata-bus-dmamap-load-page-fault-where-600x440.jpg

I'm writing AHCI-capable driver which based on ata(4) and I have
the same problem. Problem was introduced with this commit.
AHCI driver is trying use DMA without ata_dmaalloc call.
Problem fixed for me with attached patch.

-- 
WBR, Andrey V. Elsukov
-------------- next part --------------
--- ata.orig/ata-pci.c	2008-06-03 13:17:59.000000000 +0400
+++ ata/ata-pci.c	2008-06-03 13:33:36.000000000 +0400
@@ -617,14 +622,16 @@ ata_pcichannel_attach(device_t dev)
     if (ctlr->dmainit)
 	ctlr->dmainit(dev);
 
-    if ((error = ctlr->allocate(dev)))
-	return error;
+    if (ch->dma.alloc)
+	ch->dma.alloc(dev);
 
-    if ((error = ata_attach(dev)))
+    if ((error = ctlr->allocate(dev))) {
+	if (ch->dma.free)
+	    ch->dma.free(dev);
 	return error;
+    }
 
-    ch->dma.alloc(dev);
-    return 0;
+    return ata_attach(dev);
 }
 
 static int


More information about the cvs-src mailing list