]> Git Repo - J-linux.git/commitdiff
ALSA: memalloc: don't use GFP_COMP for non-coherent dma allocations
authorChristoph Hellwig <[email protected]>
Tue, 20 Dec 2022 08:05:36 +0000 (09:05 +0100)
committerChristoph Hellwig <[email protected]>
Wed, 21 Dec 2022 07:45:17 +0000 (08:45 +0100)
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 ffcb75458460 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: ffcb75458460 ("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]>
sound/core/memalloc.c

index 3cf5a87d69eaf3632842866386bd74a25e1db745..81025f50a54229b080b9069b8003a891bb5e16a7 100644 (file)
@@ -542,7 +542,7 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
        void *p;
 
        sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir,
-                                     DEFAULT_GFP | __GFP_COMP, 0);
+                                     DEFAULT_GFP, 0);
 #ifdef CONFIG_SND_DMA_SGBUF
        if (!sgt && !get_dma_ops(dmab->dev.dev)) {
                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)
        void *p;
 
        p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
-                                 dmab->dev.dir, DEFAULT_GFP | __GFP_COMP);
+                                 dmab->dev.dir, DEFAULT_GFP);
        if (p)
                dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr);
        return p;
This page took 0.067433 seconds and 4 git commands to generate.