]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: memalloc: Try dma_alloc_noncontiguous() at first
authorTakashi Iwai <tiwai@suse.de>
Sat, 12 Nov 2022 08:47:18 +0000 (09:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 12 Nov 2022 08:48:51 +0000 (09:48 +0100)
commitfb7db45eb0da77ca5292092a8a6444b173bf50f6
treedfc3999923e3facea7df340060046d41e01dfe15
parent9a898a1f00d737569973614ade6be899d1e96f5f
ALSA: memalloc: Try dma_alloc_noncontiguous() at first

The latest fix for the non-contiguous memalloc helper changed the
allocation method for a non-IOMMU system to use only the fallback
allocator.  This should have worked, but it caused a problem sometimes
when too many non-contiguous pages are allocated that can't be treated
by HD-audio controller.

As a quirk workaround, go back to the original strategy: use
dma_alloc_noncontiguous() at first, and apply the fallback only when
it fails, but only for non-IOMMU case.

We'll need a better fix in the fallback code as well, but this
workaround should paper over most cases.

Fixes: 406c2274c602 ("ALSA: memalloc: Don't fall back for SG-buffer with IOMMU")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wgSH5ubdvt76gNwa004ooZAEJL_1Q-Fyw5M2FDdqL==dg@mail.gmail.com
Link: https://lore.kernel.org/r/20221112084718.3305-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/memalloc.c