Index | Thread | Search

From:
Patrick Wildt <patrick@blueri.se>
Subject:
smmu(4): don't always set DMA coherent tag
To:
tech@openbsd.org
Cc:
kettenis@openbsd.org
Date:
Wed, 27 Aug 2025 14:03:39 +0200

Download raw body.

Thread
Hi,

SMMUs don't necessarily influence device DMA coherency attributes.
I assume we have been lucky so far that our machines that have an
SMMUv2 usually have devices with DMA coherency.  On the RK3588
this is not the case, and us always adding the COHERENT flag makes
devices fail to work when used with smmu(4) enabled.

Please give this a run on machines where "dmesg | grep ^smmu" shows
some output.

Cheers,
Patrick

diff --git a/sys/arch/arm64/dev/smmu.c b/sys/arch/arm64/dev/smmu.c
index f57796fdb97..fafbe3189b5 100644
--- a/sys/arch/arm64/dev/smmu.c
+++ b/sys/arch/arm64/dev/smmu.c
@@ -575,7 +575,6 @@ smmu_device_map(void *cookie, uint32_t sid, bus_dma_tag_t dmat)
 		dom->sd_dmat->_dmamap_load_uio = smmu_dmamap_load_uio;
 		dom->sd_dmat->_dmamap_load_raw = smmu_dmamap_load_raw;
 		dom->sd_dmat->_dmamap_unload = smmu_dmamap_unload;
-		dom->sd_dmat->_flags |= BUS_DMA_COHERENT;
 	}
 
 	return dom->sd_dmat;