From c648a1697462ccd3c99a0a1ab9c136da0d8274bf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 31 Aug 2023 13:44:37 +0000 Subject: [PATCH] Revert "ALSA: pcm: Use SG-buffer only when direct DMA is available" This reverts commit 140797d0a46e2c321b7aa0674488927c00e3bd8b which is commit 3ad796cbc36a7bc8bfd4de191d791b9490bc112b upstream. It breaks the Android abi. If it is required in the future, it can come back in an abi-safe way. Bug: 161946584 Change-Id: I598f1eb85eb53626e381c0225b6cbc04bd292294 Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_memory.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 97b471d7b32e..94bd5de01a4d 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -39,18 +38,6 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev, if (max_alloc_per_card && card->total_pcm_alloc_bytes + size > max_alloc_per_card) return -ENOMEM; - - if (IS_ENABLED(CONFIG_SND_DMA_SGBUF) && - (type == SNDRV_DMA_TYPE_DEV_SG || type == SNDRV_DMA_TYPE_DEV_UC_SG) && - !dma_is_direct(get_dma_ops(dev))) { - /* mutate to continuous page allocation */ - dev_dbg(dev, "Use continuous page allocator\n"); - if (type == SNDRV_DMA_TYPE_DEV_SG) - type = SNDRV_DMA_TYPE_DEV; - else - type = SNDRV_DMA_TYPE_DEV_UC; - } - err = snd_dma_alloc_pages(type, dev, size, dmab); if (!err) { mutex_lock(&card->memory_mutex);