Skip to content

Commit 833bd28

Browse files
baruchsiachChristoph Hellwig
authored andcommitted
arm64: mm: fix DMA zone when dma-ranges is missing
Some platforms, like Rockchip RK3568 based Odroid M1, do not provide DMA limits information in device-tree dma-ranges property. Still some device drivers set DMA limit that relies on DMA zone at low 4GB memory area. Until commit ba0fb44 ("dma-mapping: replace zone_dma_bits by zone_dma_limit"), zone_sizes_init() restricted DMA zone to low 32-bit. Restore DMA zone 32-bit limit when the platform provides no DMA bus limit information. Fixes: ba0fb44 ("dma-mapping: replace zone_dma_bits by zone_dma_limit") Reported-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Suggested-by: Robin Murphy <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent b5c58b2 commit 833bd28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/mm/init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ static void __init arch_reserve_crashkernel(void)
116116

117117
static phys_addr_t __init max_zone_phys(phys_addr_t zone_limit)
118118
{
119+
if (zone_limit == PHYS_ADDR_MAX)
120+
zone_limit = U32_MAX;
121+
119122
return min(zone_limit, memblock_end_of_DRAM() - 1) + 1;
120123
}
121124

0 commit comments

Comments
 (0)