Revert "ALSA: pcm: Use SG-buffer only when direct DMA is available"

This reverts commit 140797d0a4 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 <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-08-31 13:44:37 +00:00
parent bd7fae9e3e
commit c648a16974

View File

@ -11,7 +11,6 @@
#include <linux/moduleparam.h>
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/dma-mapping.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@ -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);