diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -66,7 +66,6 @@ BF_KMEM_ALLOC_PAGES = 0x04, BF_KMEM_ALLOC_CONTIG = 0x08, BF_KMEM_ALLOC = BF_KMEM_ALLOC_PAGES | BF_KMEM_ALLOC_CONTIG, - BF_COHERENT = 0x10, }; struct bounce_page; @@ -188,7 +187,7 @@ #define DMAMAP_CACHELINE_FLAGS \ (DMAMAP_FROM_DMAMEM | DMAMAP_COHERENT | DMAMAP_MBUF) - if ((dmat->bounce_flags & BF_COHERENT) != 0) + if ((dmat->common.flags & BUS_DMA_COHERENT) != 0) return (false); if (map != NULL && (map->flags & DMAMAP_CACHELINE_FLAGS) != 0) return (false); @@ -266,19 +265,12 @@ newtag->map_count = 0; newtag->segments = NULL; - if ((flags & BUS_DMA_COHERENT) != 0) { - newtag->bounce_flags |= BF_COHERENT; - } - if (parent != NULL) { if ((parent->bounce_flags & BF_COULD_BOUNCE) != 0) newtag->bounce_flags |= BF_COULD_BOUNCE; - - /* Copy some flags from the parent */ - newtag->bounce_flags |= parent->bounce_flags & BF_COHERENT; } - if ((newtag->bounce_flags & BF_COHERENT) != 0) { + if ((newtag->common.flags & BUS_DMA_COHERENT) != 0) { newtag->alloc_alignment = newtag->common.alignment; newtag->alloc_size = newtag->common.maxsize; } else { @@ -449,7 +441,7 @@ if (error == 0) { dmat->map_count++; - if ((dmat->bounce_flags & BF_COHERENT) != 0) + if ((dmat->common.flags & BUS_DMA_COHERENT) != 0) (*mapp)->flags |= DMAMAP_COHERENT; } else { free(*mapp, M_DEVBUF); @@ -515,7 +507,7 @@ if (flags & BUS_DMA_NOCACHE) attr = VM_MEMATTR_UNCACHEABLE; else if ((flags & BUS_DMA_COHERENT) != 0 && - (dmat->bounce_flags & BF_COHERENT) == 0) + (dmat->common.flags & BUS_DMA_COHERENT) == 0) /* * If we have a non-coherent tag, and are trying to allocate * a coherent block of memory it needs to be uncached. @@ -540,7 +532,7 @@ * tag was already marked as coherent. */ if (attr == VM_MEMATTR_UNCACHEABLE || - (dmat->bounce_flags & BF_COHERENT) != 0) + (dmat->common.flags & BUS_DMA_COHERENT) != 0) (*mapp)->flags |= DMAMAP_COHERENT; (*mapp)->flags |= DMAMAP_FROM_DMAMEM; diff --git a/sys/arm64/arm64/busdma_machdep.c b/sys/arm64/arm64/busdma_machdep.c --- a/sys/arm64/arm64/busdma_machdep.c +++ b/sys/arm64/arm64/busdma_machdep.c @@ -85,6 +85,10 @@ common->nsegments = nsegments; common->maxsegsz = maxsegsz; common->flags = flags; + /* Copy the coherent flags from the parent */ + if (parent != NULL) + common->flags |= parent->flags & BUS_DMA_COHERENT; + if (lockfunc != NULL) { common->lockfunc = lockfunc; common->lockfuncarg = lockfuncarg;