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;
 
_______________________________________________
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