Skip to content

Commit 63f067e

Browse files
author
Christoph Hellwig
committed
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Greg Ungerer <gerg@linux-m68k.org> Tested-by: Greg Ungerer <gerg@linux-m68k.org>
1 parent b1da46d commit 63f067e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kernel/dma/direct.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,10 @@ void *dma_direct_alloc(struct device *dev, size_t size,
240240
*/
241241
set_uncached = IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED);
242242
remap = IS_ENABLED(CONFIG_DMA_DIRECT_REMAP);
243-
if (!set_uncached && !remap)
243+
if (!set_uncached && !remap) {
244+
pr_warn_once("coherent DMA allocations not supported on this platform.\n");
244245
return NULL;
246+
}
245247
}
246248

247249
/*

0 commit comments

Comments
 (0)