summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-05-13 15:15:54 +0000
committerandrew <andrew@FreeBSD.org>2016-05-13 15:15:54 +0000
commitb9c729f4dbb05640fa254f3994dd67d2978adf3d (patch)
tree4c31cb11b03b21bf83ab1a0d8abc0672392352aa
parent582dada9d8d49055af5ec2efe55ac12622964158 (diff)
downloadFreeBSD-src-b9c729f4dbb05640fa254f3994dd67d2978adf3d.zip
FreeBSD-src-b9c729f4dbb05640fa254f3994dd67d2978adf3d.tar.gz
Add DMA sync operations around accessing the dwmmc descriptor ring. Even
with it maps as cache-coherent we still need to call bus_dmamap_sync. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/dev/mmc/host/dwmmc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c
index f96eff6..fe08fe9 100644
--- a/sys/dev/mmc/host/dwmmc.c
+++ b/sys/dev/mmc/host/dwmmc.c
@@ -722,6 +722,9 @@ dma_done(struct dwmmc_softc *sc, struct mmc_command *cmd)
bus_dmamap_sync(sc->buf_tag, sc->buf_map,
BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(sc->desc_tag, sc->desc_map,
+ BUS_DMASYNC_POSTWRITE);
+
bus_dmamap_unload(sc->buf_tag, sc->buf_map);
return (0);
@@ -766,6 +769,10 @@ dma_prepare(struct dwmmc_softc *sc, struct mmc_command *cmd)
if (err != 0)
panic("dmamap_load failed\n");
+ /* Ensure the device can see the desc */
+ bus_dmamap_sync(sc->desc_tag, sc->desc_map,
+ BUS_DMASYNC_PREWRITE);
+
if (data->flags & MMC_DATA_WRITE)
bus_dmamap_sync(sc->buf_tag, sc->buf_map,
BUS_DMASYNC_PREWRITE);
OpenPOWER on IntegriCloud