From: Stephen Rothwell Date: Thu, 2 Sep 2021 00:40:19 +0000 (+1000) Subject: Merge remote-tracking branch 'swiotlb/linux-next' X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2cd89aa328f31617384651d9f65e78f2472740bb;p=users%2Fjedix%2Flinux-maple.git Merge remote-tracking branch 'swiotlb/linux-next' # Conflicts: # kernel/dma/direct.c --- 2cd89aa328f31617384651d9f65e78f2472740bb diff --cc kernel/dma/direct.c index 8dca4f97d12d,2de33e5d302b..4c6c5e0635e3 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@@ -155,15 -174,10 +174,16 @@@ void *dma_direct_alloc(struct device *d } if (!IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED) && - !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && !dev_is_dma_coherent(dev) && + !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && + !IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) && - !dev_is_dma_coherent(dev)) ++ !dev_is_dma_coherent(dev) && + !is_swiotlb_for_alloc(dev)) return arch_dma_alloc(dev, size, dma_handle, gfp, attrs); + if (IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) && + !dev_is_dma_coherent(dev)) + return dma_alloc_from_global_coherent(dev, size, dma_handle); + /* * Remapping or decrypting memory may block. If either is required and * we can't block, allocate the memory from the atomic pools. @@@ -259,9 -278,8 +284,10 @@@ void dma_direct_free(struct device *dev } if (!IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED) && - !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && !dev_is_dma_coherent(dev) && + !IS_ENABLED(CONFIG_DMA_DIRECT_REMAP) && + !IS_ENABLED(CONFIG_DMA_GLOBAL_POOL) && - !dev_is_dma_coherent(dev)) { ++ !dev_is_dma_coherent(dev) && + !is_swiotlb_for_alloc(dev)) { arch_dma_free(dev, size, cpu_addr, dma_addr, attrs); return; }