Date: Thu, 2 Dec 2010 03:34:27 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r216110 - user/nwhitehorn/ps3/powerpc/powerpc Message-ID: <201012020334.oB23YR0h073335@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) &&
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012020334.oB23YR0h073335>