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