@@ -116,15 +116,6 @@ static void __init arch_reserve_crashkernel(void)
116116
117117static phys_addr_t __init max_zone_phys (phys_addr_t zone_limit )
118118{
119- /**
120- * Information we get from firmware (e.g. DT dma-ranges) describe DMA
121- * bus constraints. Devices using DMA might have their own limitations.
122- * Some of them rely on DMA zone in low 32-bit memory. Keep low RAM
123- * DMA zone on platforms that have RAM there.
124- */
125- if (memblock_start_of_DRAM () < U32_MAX )
126- zone_limit = min (zone_limit , U32_MAX );
127-
128119 return min (zone_limit , memblock_end_of_DRAM () - 1 ) + 1 ;
129120}
130121
@@ -140,6 +131,14 @@ static void __init zone_sizes_init(void)
140131 acpi_zone_dma_limit = acpi_iort_dma_get_max_cpu_address ();
141132 dt_zone_dma_limit = of_dma_get_max_cpu_address (NULL );
142133 zone_dma_limit = min (dt_zone_dma_limit , acpi_zone_dma_limit );
134+ /*
135+ * Information we get from firmware (e.g. DT dma-ranges) describe DMA
136+ * bus constraints. Devices using DMA might have their own limitations.
137+ * Some of them rely on DMA zone in low 32-bit memory. Keep low RAM
138+ * DMA zone on platforms that have RAM there.
139+ */
140+ if (memblock_start_of_DRAM () < U32_MAX )
141+ zone_dma_limit = min (zone_dma_limit , U32_MAX );
143142 arm64_dma_phys_limit = max_zone_phys (zone_dma_limit );
144143 max_zone_pfns [ZONE_DMA ] = PFN_DOWN (arm64_dma_phys_limit );
145144#endif
0 commit comments