]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ALSA: qc_audio_offload: try to reduce address space confusion
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 May 2025 12:34:42 +0000 (14:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 12:34:10 +0000 (14:34 +0200)
commit3335a1bbd62417fc60a043c7f64684c99cb841a2
treeadb13f9273ceda3c1d7d434fb5dc87075d6c3ec7
parent5c7ef5001292d70d09d90bc2251f7d869b9d135c
ALSA: qc_audio_offload: try to reduce address space confusion

uaudio_transfer_buffer_setup() allocates a buffer for the subs->dev
device, and the returned address for the buffer is a CPU local virtual
address that may or may not be in the linear mapping, as well as a DMA
address token that is accessible by the USB device, and this in turn
may or may not correspond to the physical address.

The use in the driver however assumes that these addresses are the
linear map and the CPU physical address, respectively. Both are
nonportable here, but in the end only the virtual address gets
used by converting it to a physical address that gets mapped into
a second iommu.

Make this more explicit by pulling the conversion out first
and warning if it is not part of the linear map, and using the
actual physical address to map into the iommu in place of the
dma address that may already be iommu-mapped into the usb host.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250513123442.159936-4-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/qcom/qc_audio_offload.c