svn commit: r216110 - user/nwhitehorn/ps3/powerpc/powerpc

Nathan Whitehorn nwhitehorn at FreeBSD.org
Thu Dec 2 03:34:28 UTC 2010


Author: nwhitehorn
Date: Thu Dec  2 03:34:27 2010
New Revision: 216110
URL: http://svn.freebsd.org/changeset/base/216110

Log:
  The useful thing about IOMMUs is that they avoid needing bounce pages.
  Don't use bounce pages if an IOMMU is set up.

Modified:
  user/nwhitehorn/ps3/powerpc/powerpc/busdma_machdep.c

Modified: user/nwhitehorn/ps3/powerpc/powerpc/busdma_machdep.c
==============================================================================
--- user/nwhitehorn/ps3/powerpc/powerpc/busdma_machdep.c	Thu Dec  2 03:10:35 2010	(r216109)
+++ user/nwhitehorn/ps3/powerpc/powerpc/busdma_machdep.c	Thu Dec  2 03:34:27 2010	(r216110)
@@ -160,10 +160,14 @@ run_filter(bus_dma_tag_t dmat, bus_addr_
 	retval = 0;
 
 	do {
-		if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr)
-		 || ((paddr & (dmat->alignment - 1)) != 0))
-		 && (dmat->filter == NULL
-		  || (*dmat->filter)(dmat->filterarg, paddr) != 0))
+		if (dmat->filter == NULL && dmat->iommu == NULL &&
+		    paddr > dmat->lowaddr && paddr <= dmat->highaddr)
+			retval = 1;
+		if (dmat->filter == NULL &&
+		    (paddr & (dmat->alignment - 1)) != 0)
+			retval = 1;
+		if (dmat->filter != NULL &&
+		    (*dmat->filter)(dmat->filterarg, paddr) != 0)
 			retval = 1;
 
 		dmat = dmat->parent;		
@@ -287,8 +291,10 @@ bus_dma_tag_create(bus_dma_tag_t parent,
 		newtag->iommu_cookie = parent->iommu_cookie;
 	}
 
-	if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem)
-	 || newtag->alignment > 1)
+	if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) && newtag->iommu == NULL)
+		newtag->flags |= BUS_DMA_COULD_BOUNCE;
+
+	if (newtag->alignment > 1)
 		newtag->flags |= BUS_DMA_COULD_BOUNCE;
 
 	if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) &&


More information about the svn-src-user mailing list