ALSA: pci: rme: Fix unaligned buffer addresses
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Nov 2021 14:57:52 +0000 (15:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:15:55 +0000 (19:15 +0100)
commitb9d4a8993500dd2e95fa336c6b003a4f28880973
tree95044d2fdd69d0b52f340d7f1e97a9f9a3c7c51c
parent9a520938980b8b7cf0e16f1ef61fac91fb0e8e31
ALSA: pci: rme: Fix unaligned buffer addresses

commit 43d35ccc36dad52377dd349b2e3ea803b72c3906 upstream.

The recent fix for setting up the DMA buffer type on RME drivers tried
to address the non-standard memory managements and changed the DMA
buffer information to the standard snd_dma_buffer object that is
allocated at the probe time.  However, I overlooked that the RME
drivers handle the buffer addresses based on 64k alignment, and the
previous conversion broke that silently.

This patch is an attempt to fix the regression.  The snd_dma_buffer
objects are copied to the original data with the correction to the
aligned accesses, and those are passed to snd_pcm_set_runtime_buffer()
helpers instead.  The original snd_dma_buffer objects are managed by
devres, hence they'll be released automagically.

Fixes: 0899a7a23047 ("ALSA: pci: rme: Set up buffer type properly")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211108145752.30572-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/rme9652.c