Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2016 09:50:51 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r306086 - stable/11/sys/arm64/arm64
Message-ID:  <201609210950.u8L9op73083073@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed Sep 21 09:50:50 2016
New Revision: 306086
URL: https://svnweb.freebsd.org/changeset/base/306086

Log:
  MFC 304799:
  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.
  
  Obtained from:  ABT Systems Ltd
  Sponsored by:   The FreeBSD Foundation

Modified:
  stable/11/sys/arm64/arm64/busdma_bounce.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm64/arm64/busdma_bounce.c
==============================================================================
--- stable/11/sys/arm64/arm64/busdma_bounce.c	Wed Sep 21 09:45:14 2016	(r306085)
+++ stable/11/sys/arm64/arm64/busdma_bounce.c	Wed Sep 21 09:50:50 2016	(r306086)
@@ -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?201609210950.u8L9op73083073>