]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ALSA: memalloc: Use proper DMA mapping API for x86 S/G buffer allocations
authorTakashi Iwai <tiwai@suse.de>
Thu, 12 Sep 2024 15:52:25 +0000 (17:52 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 12 Sep 2024 16:02:18 +0000 (18:02 +0200)
commit0b9f2bd00fc3677e38ae5e46ff79b8d48d9cb02e
tree78ca421c467de117671f974bced38aea530c99a3
parentc880a5146642e9d35f88aaa353ae98ffd4fc3f99
ALSA: memalloc: Use proper DMA mapping API for x86 S/G buffer allocations

The fallback S/G buffer allocation for x86 used the addresses deduced
from the page allocations blindly.  It broke the allocations on IOMMU
and made us to work around with a hackish DMA ops check.

For cleaning up those messes, this patch switches to the proper DMA
mapping API usages with the standard sg-table instead.

By introducing the sg-table, the address table isn't needed, but for
keeping the original allocation sizes for freeing, replace it with the
array keeping the number of pages.

The get_addr callback is changed to use the existing one for
non-contiguous buffers.  (Also it's the reason sg_table is put at the
beginning of struct snd_dma_sg_fallback.)

And finally, the hackish workaround that checks the DMA ops is
dropped now.

Link: https://patch.msgid.link/20240912155227.4078-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/memalloc.c