linux/sound/usb/qcom
Takashi Iwai 44499ecb4f ALSA: usb: qcom: Fix false-positive address space check
The sanity check previously added to uaudio_transfer_buffer_setup()
assumed the allocated buffer being linear-mapped.  But the buffer
allocated via usb_alloc_coherent() isn't always so, rather to be used
with (SG-)DMA API.  This leaded to a false-positive warning and the
driver failed to work.

Actually uaudio_transfer_buffer_setup() deals only with the DMA-API
addresses for MEM_XFER_BUF type, while other callers of
uaudio_iommu_map() are with pages with physical addresses for
MEM_EVENT_RING and MEM_XFER_RING types.  So this patch splits the
mapping helper function to two different ones, uaudio_iommu_map() for
the DMA pages and uaudio_iommu_map_pa() for the latter, in order to
handle mapping differently for each type.  Along with it, the
unnecessary address check that caused probe error is dropped, too.

Fixes: 3335a1bbd6 ("ALSA: qc_audio_offload: try to reduce address space confusion")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reported-and-tested-by: Luca Weiss <luca.weiss@fairphone.com>
Closes: https://lore.kernel.org/DBR2363A95M1.L9XBNC003490@fairphone.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-09-17 15:10:58 +02:00
..
Makefile ALSA: usb-audio: qcom: Add USB offload route kcontrol 2025-04-11 13:02:33 +02:00
mixer_usb_offload.c ALSA: usb-audio: qcom: Add USB offload route kcontrol 2025-04-11 13:02:33 +02:00
mixer_usb_offload.h ALSA: usb-audio: qcom: Add USB offload route kcontrol 2025-04-11 13:02:33 +02:00
qc_audio_offload.c ALSA: usb: qcom: Fix false-positive address space check 2025-09-17 15:10:58 +02:00
usb_audio_qmi_v01.c ALSA: qc_audio_offload: rename dma/iova/va/cpu/phys variables 2025-05-21 14:34:10 +02:00
usb_audio_qmi_v01.h ALSA: qc_audio_offload: rename dma/iova/va/cpu/phys variables 2025-05-21 14:34:10 +02:00