staging: bcm2835-audio: Use coherent device buffers
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Sep 2018 15:58:54 +0000 (17:58 +0200)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:31 +0000 (00:08 +0100)
commit411bad968c2aa7548a60482616d97bf9861800f9
tree63a10697ec66190861da894aedd2ad51373262ca
parent96f9726eeec7fd9c1ce8985161e69c5a3f3cf87c
staging: bcm2835-audio: Use coherent device buffers

commit ad29c6e6cbf6f2af7362b043adad51a3be3d39c7 upstream.

The memory access to the pages allocated with
SNDRV_DMA_TYPE_CONTINUOUS are basically non-coherent, and it becomes a
problem when a process accesses via mmap.

For the more consistent access, use the device coherent memory, just
by replacing the call pattern in the allocator helpers.

The only point we need to be careful for is the device object passed
there; since bcm2835-audio driver creates fake devices and each card
is created on top of that, we need to pass its parent device as the
real device object.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c