From d3d8ca74251869f1068c69fc4f40a96cb9a02d62 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 5 Nov 2020 09:55:55 +0000 Subject: [PATCH] Stop trying to bounce in memory allocated by bus dma Memory allocated by bus_dmamem_alloc will take into account any alignment requirements of the CPU it's running on. Stop trying to bounce in this case as there is no bounce zone allocated. Reported by: manu, tuexen Tested by: manu Sponsored by: Innovate UK --- sys/arm64/arm64/busdma_bounce.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index 463309e26372..7346d2949251 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -206,6 +206,10 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr, bus_size_t size) { + /* Memory allocated by bounce_bus_dmamem_alloc won't bounce */ + if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) + return (false); + if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) return (true);