Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2016 10:53:03 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304799 - head/sys/arm64/arm64
Message-ID:  <201608251053.u7PAr3Ja026092@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Thu Aug 25 10:53:03 2016
New Revision: 304799
URL: https://svnweb.freebsd.org/changeset/base/304799

Log:
  Map coherent memory in a non-coherent dma tag as uncached. This is similar
  to what the 32-bit arm code does, with the exception that it always assumes
  the tag is non-coherent.
  
  Tested by:	jmcneill
  Obtained from:	ABT Systems Ltd
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/busdma_bounce.c

Modified: head/sys/arm64/arm64/busdma_bounce.c
==============================================================================
--- head/sys/arm64/arm64/busdma_bounce.c	Thu Aug 25 10:29:41 2016	(r304798)
+++ head/sys/arm64/arm64/busdma_bounce.c	Thu Aug 25 10:53:03 2016	(r304799)
@@ -438,6 +438,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm
 		mflags |= M_ZERO;
 	if (flags & BUS_DMA_NOCACHE)
 		attr = VM_MEMATTR_UNCACHEABLE;
+	else if ((flags & BUS_DMA_COHERENT) != 0 &&
+	    (dmat->bounce_flags & BF_COHERENT) == 0)
+		/*
+		 * If we have a non-coherent tag, and are trying to allocate
+		 * a coherent block of memory it needs to be uncached.
+		 */
+		attr = VM_MEMATTR_UNCACHEABLE;
 	else
 		attr = VM_MEMATTR_DEFAULT;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608251053.u7PAr3Ja026092>