Re: debug_dma_assert_idle - snd_hda_intel - cpu touching an active dma mapped cacheline

From: Dan Williams
Date: Thu May 01 2014 - 13:24:41 EST


On Thu, Apr 17, 2014 at 12:40 AM, Clemens Ladisch <clemens@xxxxxxxxxx> wrote:
> poma wrote:
>> Sound whispers,
>
> ???
>
>> WARNING: CPU: 3 PID: 900 at lib/dma-debug.c:593 debug_dma_assert_idle+0x159/0x1d0()
>> snd_hda_intel 0000:00:07.0: DMA-API: cpu touching an active dma mapped cacheline [cln=0x03014000]
>> ...
>> Mapped at:
>> [<c074ec12>] debug_dma_alloc_coherent+0x22/0x70
>
> "Coherent" means "touching DMA mappings is allowed".
> Why does dma-debug complain about that?

Right, but coherency does not follow copy-on-write. The check is
there to catch cases where a page is COW'd while an active dma mapping
on the source page is present. Sure, the write is coherent, but due
to the COW it's going to the wrong page, so you are potentially
missing data in the new mapping.

See how NET_DMA inspired this check:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/dma/Kconfig?id=77873803363c
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/