Author: andrew
Date: Fri May 13 15:15:54 2016
New Revision: 299679
URL: https://svnweb.freebsd.org/changeset/base/299679

Log:
  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

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c       Fri May 13 15:11:17 2016        
(r299678)
+++ head/sys/dev/mmc/host/dwmmc.c       Fri May 13 15:15:54 2016        
(r299679)
@@ -722,6 +722,9 @@ dma_done(struct dwmmc_softc *sc, struct 
                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, stru
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to