Subject: Re: DPAA2 triggers, [PATCH] dma debug: report -EEXIST errors in add_dma_entry

From: Christoph Hellwig <[email-masked]>
Date: Fri, 1 Oct 2021 06:19:59 +0200

On Tue, Sep 14, 2021 at 03:45:06PM +0000, Ioana Ciornei wrote:
> [  245.927020] fsl_dpaa2_eth dpni.3: scather-gather idx 0 P=20a7320000 N=20a7320 D=20a7320000 L=30 DMA_BIDIRECTIONAL dma map error check not applicable·
> [  245.927048] fsl_dpaa2_eth dpni.3: scather-gather idx 1 P=20a7320030 N=20a7320 D=20a7320030 L=5a8 DMA_BIDIRECTIONAL dma map error check not applicable
> [  245.927062] DMA-API: cacheline tracking EEXIST, overlapping mappings aren't supported
> 
> The first line is the dump of the dma_debug_entry which is already present
> in the radix tree and the second one is the entry which just triggered
> the EEXIST.
> 
> As we can see, they are not actually overlapping, at least from my
> understanding. The first one starts at 0x20a7320000 with a size 0x30
> and the second one at 0x20a7320030.

They overlap the cache lines.  Which means if you use this driver
on a system that is not dma coherent you will corrupt data.