svn commit: r274538 - head/sys/arm/arm

Ian Lepore ian at FreeBSD.org
Sat Nov 15 03:39:59 UTC 2014


Author: ian
Date: Sat Nov 15 03:39:58 2014
New Revision: 274538
URL: https://svnweb.freebsd.org/changeset/base/274538

Log:
  When doing busdma sync ops for BUSDMA_COHERENT memory, there is no need
  for cache maintenance operations, but ensure that all prior writes have
  reached memory when doing a PREWRITE sync.
  
  Submitted by:	Michal Meloun <meloun at miracle.cz>

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep-v6.c	Sat Nov 15 03:34:34 2014	(r274537)
+++ head/sys/arm/arm/busdma_machdep-v6.c	Sat Nov 15 03:39:58 2014	(r274538)
@@ -1385,8 +1385,18 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus
 			dmat->bounce_zone->total_bounced++;
 		}
 	}
-	if (map->flags & DMAMAP_COHERENT)
+
+	/*
+	 * For COHERENT memory no cache maintenance is necessary, but ensure all
+	 * writes have reached memory for the PREWRITE case.
+	 */
+	if (map->flags & DMAMAP_COHERENT) {
+		if (op & BUS_DMASYNC_PREWRITE) {
+		    dsb();
+		    cpu_l2cache_drain_writebuf();
+		}
 		return;
+	}
 
 	if (map->sync_count != 0) {
 		if (!pmap_dmap_iscurrent(map->pmap))


More information about the svn-src-all mailing list