]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rsnd: Enable IPMMU v2
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 16 Apr 2018 05:14:01 +0000 (05:14 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 16 Apr 2018 11:38:01 +0000 (12:38 +0100)
commit5030258736fe3ddde6ce3c9059a752224511b913
tree0edeacb3eab54c2eee0362df54ce46a36e1df477
parent7d47a8062c4bad20625beea92a599461d2d36e99
ASoC: rsnd: Enable IPMMU v2

commit 1bb3b1670380f ("ASoC: rsnd: use dma_sync_single_for_xxx() for
IOMMU") (= v1) which have been already reverted had supported IPMMU
support on rsnd driver.
Because memory allocating timing and DMAEngine access timing were
different, it used continuous memory and called dma map function by
itself.

OTOH, it is using DMA descriptor mode (= DMA cyclic mode), thus, there
was timing conflict between DMA sync/unsync and DMA transfer starting,
and it maked sound noise.

This patch supports IPMMU with coherent memory, and, it uses Audio DMAC
dev for allocating memory by snd_pcm_lib_preallocate_pages_for_all() to
indicate memory area to IPMMU.
One note is that Playback/Capture need each paired Audio DMAC dev.
Because of this, we need to keep each paired Audio DMAC dev when probing,
and use it when allocating each memory for IPMMU.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/dma.c
sound/soc/sh/rcar/rsnd.h