aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-11-12 09:23:32 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-11-12 09:23:32 -0800
commitf95077acac6d3235735a41cc5f25a024777399dd (patch)
tree91964ef9722f8daddddb13c0079ad6c3fa190b27
parent8f2975c2bb4c6fd43d778db55481fc11806c8773 (diff)
parent9d8e536d36e75e76614fe09ffab9a1df95b8b666 (diff)
downloadlinux-f95077acac6d3235735a41cc5f25a024777399dd.tar.gz
Merge tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull additional sound fix from Takashi Iwai: "A regression fix for the latest memalloc helper change" * tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: memalloc: Try dma_alloc_noncontiguous() at first
-rw-r--r--sound/core/memalloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 6a81aaab25ab02..ba095558b6d165 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -542,8 +542,10 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
struct sg_table *sgt;
void *p;
+ sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
+ DEFAULT_GFP, 0);
#ifdef CONFIG_SND_DMA_SGBUF
- if (!get_dma_ops(dmab->dev.dev)) {
+ if (!sgt && !get_dma_ops(dmab->dev.dev)) {
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG)
dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK;
else
@@ -551,9 +553,6 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
return snd_dma_sg_fallback_alloc(dmab, size);
}
#endif
-
- sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
- DEFAULT_GFP, 0);
if (!sgt)
return NULL;