Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'dma-mapping-2022-12-23' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fixes from Christoph Hellwig:
"Fix up the sound code to not pass __GFP_COMP to the non-coherent DMA
allocator, as it copes with that just as badly as the coherent
allocator, and then add a check to make sure no one passes the flag
ever again"

* tag 'dma-mapping-2022-12-23' of git://git.infradead.org/users/hch/dma-mapping:
dma-mapping: reject GFP_COMP for noncoherent allocations
ALSA: memalloc: don't use GFP_COMP for non-coherent dma allocations

+6 -2
+4
kernel/dma/mapping.c
··· 560 560 return NULL; 561 561 if (WARN_ON_ONCE(gfp & (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM))) 562 562 return NULL; 563 + if (WARN_ON_ONCE(gfp & __GFP_COMP)) 564 + return NULL; 563 565 564 566 size = PAGE_ALIGN(size); 565 567 if (dma_alloc_direct(dev, ops)) ··· 646 644 struct sg_table *sgt; 647 645 648 646 if (WARN_ON_ONCE(attrs & ~DMA_ATTR_ALLOC_SINGLE_PAGES)) 647 + return NULL; 648 + if (WARN_ON_ONCE(gfp & __GFP_COMP)) 649 649 return NULL; 650 650 651 651 if (ops && ops->alloc_noncontiguous)
+2 -2
sound/core/memalloc.c
··· 542 542 void *p; 543 543 544 544 sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, 545 - DEFAULT_GFP | __GFP_COMP, 0); 545 + DEFAULT_GFP, 0); 546 546 #ifdef CONFIG_SND_DMA_SGBUF 547 547 if (!sgt && !get_dma_ops(dmab->dev.dev)) { 548 548 if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) ··· 820 820 void *p; 821 821 822 822 p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr, 823 - dmab->dev.dir, DEFAULT_GFP | __GFP_COMP); 823 + dmab->dev.dir, DEFAULT_GFP); 824 824 if (p) 825 825 dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr); 826 826 return p;