Skip to content

Commit ad67f5a

Browse files
author
Christoph Hellwig
committed
arm64: replace ZONE_DMA with ZONE_DMA32
arm64 uses ZONE_DMA for allocations below 32-bits. These days we name the zone for that ZONE_DMA32, which will allow to use the dma-direct and generic swiotlb code as-is, so rename it. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
1 parent ac2e886 commit ad67f5a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ config GENERIC_CSUM
227227
config GENERIC_CALIBRATE_DELAY
228228
def_bool y
229229

230-
config ZONE_DMA
230+
config ZONE_DMA32
231231
def_bool y
232232

233233
config HAVE_GENERIC_GUP

arch/arm64/mm/dma-mapping.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
9595
dma_addr_t *dma_handle, gfp_t flags,
9696
unsigned long attrs)
9797
{
98-
if (IS_ENABLED(CONFIG_ZONE_DMA) &&
98+
if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
9999
dev->coherent_dma_mask <= DMA_BIT_MASK(32))
100-
flags |= GFP_DMA;
100+
flags |= GFP_DMA32;
101101
if (dev_get_cma_area(dev) && gfpflags_allow_blocking(flags)) {
102102
struct page *page;
103103
void *addr;
@@ -397,7 +397,7 @@ static int __init atomic_pool_init(void)
397397
page = dma_alloc_from_contiguous(NULL, nr_pages,
398398
pool_size_order, GFP_KERNEL);
399399
else
400-
page = alloc_pages(GFP_DMA, pool_size_order);
400+
page = alloc_pages(GFP_DMA32, pool_size_order);
401401

402402
if (page) {
403403
int ret;

arch/arm64/mm/init.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static void __init reserve_elfcorehdr(void)
217217
}
218218
#endif /* CONFIG_CRASH_DUMP */
219219
/*
220-
* Return the maximum physical address for ZONE_DMA (DMA_BIT_MASK(32)). It
220+
* Return the maximum physical address for ZONE_DMA32 (DMA_BIT_MASK(32)). It
221221
* currently assumes that for memory starting above 4G, 32-bit devices will
222222
* use a DMA offset.
223223
*/
@@ -233,8 +233,8 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
233233
{
234234
unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
235235

236-
if (IS_ENABLED(CONFIG_ZONE_DMA))
237-
max_zone_pfns[ZONE_DMA] = PFN_DOWN(max_zone_dma_phys());
236+
if (IS_ENABLED(CONFIG_ZONE_DMA32))
237+
max_zone_pfns[ZONE_DMA32] = PFN_DOWN(max_zone_dma_phys());
238238
max_zone_pfns[ZONE_NORMAL] = max;
239239

240240
free_area_init_nodes(max_zone_pfns);
@@ -251,9 +251,9 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
251251
memset(zone_size, 0, sizeof(zone_size));
252252

253253
/* 4GB maximum for 32-bit only capable devices */
254-
#ifdef CONFIG_ZONE_DMA
254+
#ifdef CONFIG_ZONE_DMA32
255255
max_dma = PFN_DOWN(arm64_dma_phys_limit);
256-
zone_size[ZONE_DMA] = max_dma - min;
256+
zone_size[ZONE_DMA32] = max_dma - min;
257257
#endif
258258
zone_size[ZONE_NORMAL] = max - max_dma;
259259

@@ -266,10 +266,10 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
266266
if (start >= max)
267267
continue;
268268

269-
#ifdef CONFIG_ZONE_DMA
269+
#ifdef CONFIG_ZONE_DMA32
270270
if (start < max_dma) {
271271
unsigned long dma_end = min(end, max_dma);
272-
zhole_size[ZONE_DMA] -= dma_end - start;
272+
zhole_size[ZONE_DMA32] -= dma_end - start;
273273
}
274274
#endif
275275
if (end > max_dma) {
@@ -467,7 +467,7 @@ void __init arm64_memblock_init(void)
467467
early_init_fdt_scan_reserved_mem();
468468

469469
/* 4GB maximum for 32-bit only capable devices */
470-
if (IS_ENABLED(CONFIG_ZONE_DMA))
470+
if (IS_ENABLED(CONFIG_ZONE_DMA32))
471471
arm64_dma_phys_limit = max_zone_dma_phys();
472472
else
473473
arm64_dma_phys_limit = PHYS_MASK + 1;

0 commit comments

Comments
 (0)