Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c648a169 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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



This reverts commit 140797d0 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: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent bd7fae9e
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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);