From 1ae5318fe89a123f8143fbfd2881ab82e8b7a6e9 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sun, 6 Mar 2011 12:54:00 +0000 Subject: [PATCH] - 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 --- sys/dev/ata/ata-dma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index 872434bd7c6e..46ec73558e1f 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -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; }