mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
b1da46d70e
commit
63f067e33c
1 changed files with 3 additions and 1 deletions
|
@ -240,8 +240,10 @@ void *dma_direct_alloc(struct device *dev, size_t size,
|
||||||
*/
|
*/
|
||||||
set_uncached = IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED);
|
set_uncached = IS_ENABLED(CONFIG_ARCH_HAS_DMA_SET_UNCACHED);
|
||||||
remap = IS_ENABLED(CONFIG_DMA_DIRECT_REMAP);
|
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;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue