Skip to content

Commit db91832

Browse files
author
Christoph Hellwig
committed
ALSA: memalloc: don't use GFP_COMP for non-coherent dma allocations
While not quite as bogus as for the dma-coherent allocations that were fixed earlier, GFP_COMP for these allocations has no benefits for the dma-direct case, and can't be supported at all by dma dma-iommu backend which splits up allocations into smaller orders. Due to an oversight in ffcb754 that flag stopped being cleared for all dma allocations, but only got rejected for coherent ones. Start fixing this by not requesting __GFP_COMP in the sound code, which is the only place that did this. Fixes: ffcb754 ("dma-mapping: reject __GFP_COMP in dma_alloc_attrs") Reported-by: Mikhail Gavrilov <[email protected]> Reported-by: Kai Vehmanen <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Takashi Iwai <[email protected]> Tested-by: Mikhail Gavrilov <[email protected]> Tested-by: Kai Vehmanen <[email protected]>
1 parent 6feb57c commit db91832

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/core/memalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
542542
void *p;
543543

544544
sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
545-
DEFAULT_GFP | __GFP_COMP, 0);
545+
DEFAULT_GFP, 0);
546546
#ifdef CONFIG_SND_DMA_SGBUF
547547
if (!sgt && !get_dma_ops(dmab->dev.dev)) {
548548
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG)
@@ -820,7 +820,7 @@ static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size)
820820
void *p;
821821

822822
p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
823-
dmab->dev.dir, DEFAULT_GFP | __GFP_COMP);
823+
dmab->dev.dir, DEFAULT_GFP);
824824
if (p)
825825
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr);
826826
return p;

0 commit comments

Comments
 (0)