Skip to content

Commit aa807b9

Browse files
Feng Tangmszyprow
authored andcommitted
dma-contiguous: hornor the cma address limit setup by user
When porting a cma related usage from x86_64 server to arm64 server, the "cma=4G@4G" setup failed on arm64. The reason is arm64 and some other architectures have specific physical address limit for reserved cma area, like 4GB due to the device's need for 32 bit dma. Actually lots of platforms of those architectures don't have this device dma limit, but still have to obey it, and are not able to reserve a huge cma pool. This situation could be improved by honoring the user input cma physical address than the arch limit. As when users specify it, they already knows what the default is which probably can't suit them. Suggested-by: Robin Murphy <[email protected]> Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 19272b3 commit aa807b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/dma/contiguous.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ void __init dma_contiguous_reserve(phys_addr_t limit)
222222
if (size_cmdline != -1) {
223223
selected_size = size_cmdline;
224224
selected_base = base_cmdline;
225-
selected_limit = min_not_zero(limit_cmdline, limit);
225+
226+
/* Hornor the user setup dma address limit */
227+
selected_limit = limit_cmdline ?: limit;
228+
226229
if (base_cmdline + size_cmdline == limit_cmdline)
227230
fixed = true;
228231
} else {

0 commit comments

Comments
 (0)