svn commit: r219336 - head/sys/dev/ata

Marius Strobl marius at FreeBSD.org
Sun Mar 6 12:54:01 UTC 2011


Author: marius
Date: Sun Mar  6 12:54:00 2011
New Revision: 219336
URL: http://svn.freebsd.org/changeset/base/219336

Log:
  - Allocate the DMA memory used for the work area as coherent as at least
    the ataahci(4) and atamarvell(4) drivers share it between the host and
    the controller.
  - Spell some zeros as BUS_DMA_WAITOK when used as bus_dmamem_alloc() flags.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/ata/ata-dma.c

Modified: head/sys/dev/ata/ata-dma.c
==============================================================================
--- head/sys/dev/ata/ata-dma.c	Sun Mar  6 12:48:15 2011	(r219335)
+++ head/sys/dev/ata/ata-dma.c	Sun Mar  6 12:54:00 2011	(r219336)
@@ -104,7 +104,8 @@ ata_dmainit(device_t dev)
 			   0, NULL, NULL, &ch->dma.work_tag))
 	goto error;
 
-    if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, 0,
+    if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work,
+			 BUS_DMA_WAITOK | BUS_DMA_COHERENT,
 			 &ch->dma.work_map))
 	goto error;
 
@@ -173,8 +174,8 @@ ata_dmaalloc(device_t dev)
             goto error;
 	}
 
-	if (bus_dmamem_alloc(slot->sg_tag, (void **)&slot->sg,
-			     0, &slot->sg_map)) {
+	if (bus_dmamem_alloc(slot->sg_tag, (void **)&slot->sg, BUS_DMA_WAITOK,
+			     &slot->sg_map)) {
 	    device_printf(ch->dev, "FAILURE - alloc sg_map\n");
 	    goto error;
         }


More information about the svn-src-all mailing list