Commit 63f067e3 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-direct: warn when coherent allocations aren't supported



Log a warning once when dma_alloc_coherent fails because the platform
does not support coherent allocations at all.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Reviewed-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
Tested-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent b1da46d7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -240,9 +240,11 @@ void *dma_direct_alloc(struct device *dev, size_t size,
		 */
		set_uncached = IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED);
		remap = IS_ENABLED(CONFIG_DMA_DIRECT_REMAP);
		if (!set_uncached && !remap)
		if (!set_uncached && !remap) {
			pr_warn_once("coherent DMA allocations not supported on this platform.\n");
			return NULL;
		}
	}

	/*
	 * Remapping or decrypting memory may block, allocate the memory from