Skip to content

Commit 7d50b29

Browse files
committed
Revert "ALSA: pcm: Use SG-buffer only when direct DMA is available"
This reverts commit 3ad796c ("ALSA: pcm: Use SG-buffer only when direct DMA is available") also the modification commit 467fd0e ("ALSA: pcm: Fix build error on m68k and others"). Poking the DMA internal helper is a layer violation, so we should avoid that. Meanwhile the actual bug has been addressed by the Kconfig fix in commit dbed452 ("dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL"), so we can live without this hack. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 52bedfb commit 7d50b29

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

sound/core/pcm_memory.c

-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/moduleparam.h>
1212
#include <linux/vmalloc.h>
1313
#include <linux/export.h>
14-
#include <linux/dma-mapping.h>
1514
#include <sound/core.h>
1615
#include <sound/pcm.h>
1716
#include <sound/info.h>
@@ -41,19 +40,6 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev,
4140
card->total_pcm_alloc_bytes + size > max_alloc_per_card)
4241
return -ENOMEM;
4342

44-
45-
#ifdef CONFIG_SND_DMA_SGBUF
46-
if ((type == SNDRV_DMA_TYPE_DEV_SG || type == SNDRV_DMA_TYPE_DEV_UC_SG) &&
47-
!dma_is_direct(get_dma_ops(dev))) {
48-
/* mutate to continuous page allocation */
49-
dev_dbg(dev, "Use continuous page allocator\n");
50-
if (type == SNDRV_DMA_TYPE_DEV_SG)
51-
type = SNDRV_DMA_TYPE_DEV;
52-
else
53-
type = SNDRV_DMA_TYPE_DEV_UC;
54-
}
55-
#endif /* CONFIG_SND_DMA_SGBUF */
56-
5743
err = snd_dma_alloc_pages(type, dev, size, dmab);
5844
if (!err) {
5945
mutex_lock(&card->memory_mutex);

0 commit comments

Comments
 (0)