linux/sound/usb
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
..
6fire ALSA: 6fire: Use safer strscpy() instead of strcpy() 2025-07-11 09:53:35 +02:00
bcd2000 ALSA: bcd2000: refactor deprecated strncpy 2023-07-29 13:53:56 +02:00
caiaq ALSA: caiaq: Use snd_card_free_when_closed() at disconnection 2024-11-13 13:33:47 +01:00
hiface ALSA: usb: Use *-y instead of *-objs in Makefile 2024-05-08 18:17:53 +02:00
line6 ALSA: line6: Use safer strscpy() instead of strcpy() 2025-07-11 09:53:35 +02:00
misc ALSA: ua101: Use safer strscpy() instead of strcpy() 2025-07-11 09:53:35 +02:00
qcom ALSA: usb: qcom: Fix false-positive address space check 2025-09-17 15:10:58 +02:00
usx2y ALSA: usx2y: Use safer strscpy() instead of strcpy() 2025-07-11 09:53:35 +02:00
card.c ALSA: usb-audio: Copy string more safely 2025-07-11 09:53:36 +02:00
card.h ALSA: usb-audio: Allow for rediscovery of connected USB SND devices 2025-04-11 13:02:31 +02:00
clock.c ALSA: usb-audio: Fix out of bounds reads when finding clock sources 2024-11-25 15:48:22 +01:00
clock.h
endpoint.c Merge 6.15-rc6 into usb-next 2025-05-13 08:26:58 +02:00
endpoint.h ALSA: usb-audio: Remove unused function declaration 2023-08-01 16:56:57 +02:00
fcp.c ALSA: usb: fcp: Use USB API functions rather than constants 2025-05-16 09:57:00 +02:00
fcp.h ALSA: FCP: Add Focusrite Control Protocol driver 2025-01-18 12:00:38 +01:00
format.c ALSA: usb-audio: Allow Focusrite devices to use low samplerates 2025-09-01 13:14:52 +02:00
format.h
helper.c ALSA: usb-audio: Export USB SND APIs for modules 2025-04-11 13:02:30 +02:00
helper.h ALSA: usb-audio: Support multiple control interfaces 2024-08-12 16:17:46 +02:00
implicit.c ALSA: usb-audio: Add implicit feedback quirk for RODE AI-1 2025-06-02 16:50:04 +02:00
implicit.h
Kconfig ALSA: usb-audio: qcom: fix USB_XHCI dependency 2025-05-23 14:38:50 +02:00
Makefile ALSA: usb-audio: qcom: Introduce QC USB SND offloading support 2025-04-11 13:02:32 +02:00
media.c ALSA: pcm: Don't embed device 2023-08-17 09:23:45 +02:00
media.h
midi.c ALSA: usb-audio: Use safer strscpy() instead of strcpy() 2025-07-11 09:53:35 +02:00
midi.h ALSA: usb-audio: Manage number of rawmidis globally 2023-05-23 12:11:00 +02:00
midi2.c ALSA: usb-audio: Copy string more safely 2025-07-11 09:53:36 +02:00
midi2.h ALSA: usb-audio: USB MIDI 2.0 UMP support 2023-05-23 12:11:02 +02:00
mixer.c ALSA: usb-audio: Copy string more safely 2025-07-11 09:53:36 +02:00
mixer.h ALSA: usb-audio: Add input value sanity checks for standard types 2024-08-06 18:27:08 +02:00
mixer_maps.c ALSA: usb-audio: Rename ALSA kcontrol PCM and PCM1 for the KTMicro sound card 2025-06-13 10:18:10 +02:00
mixer_quirks.c ALSA: usb-audio: move mixer_quirks' min_mute into common quirk 2025-08-27 07:53:25 +02:00
mixer_quirks.h
mixer_s1810c.c
mixer_s1810c.h
mixer_scarlett.c ALSA: usb-audio: Copy string more safely 2025-07-11 09:53:36 +02:00
mixer_scarlett.h
mixer_scarlett2.c ALSA: usb: scarlett2: Fix missing NULL check 2025-07-31 17:04:28 +02:00
mixer_scarlett2.h ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 2023-10-27 11:22:59 +02:00
mixer_us16x08.c ALSA: usb: mixer_us16x08: use snd_kcontrol_chip() 2025-05-08 11:53:35 +02:00
mixer_us16x08.h
pcm.c ALSA: usb-audio: Don't use printk_ratelimit for debug prints 2025-08-02 16:17:50 +02:00
pcm.h ALSA: usb-audio: Export USB SND APIs for modules 2025-04-11 13:02:30 +02:00
power.c ALSA: usb-audio: Support multiple control interfaces 2024-08-12 16:17:46 +02:00
power.h ALSA: usb-audio: Support multiple control interfaces 2024-08-12 16:17:46 +02:00
proc.c ALSA: usb-audio: Copy string more safely 2025-07-11 09:53:36 +02:00
proc.h
quirks-table.h ALSA: usb-audio: Add Pioneer DJ DJM-V10 support 2025-04-22 15:00:48 +02:00
quirks.c ALSA: usb-audio: Add mute TLV for playback volumes on more devices 2025-08-29 09:50:14 +02:00
quirks.h
stream.c ALSA: usb-audio: Fix size validation in convert_chmap_v3() 2025-08-18 12:36:33 +02:00
stream.h
usbaudio.h ALSA: usb-audio: move mixer_quirks' min_mute into common quirk 2025-08-27 07:53:25 +02:00
validate.c ALSA: usb-audio: Use correct sub-type for UAC3 feature unit validation 2025-08-21 17:10:14 +02:00