Commit a573cdd7 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Catalin Marinas

arm64: rename variables used to calculate ZONE_DMA32's size

Let the name indicate that they are used to calculate ZONE_DMA32's size
as opposed to ZONE_DMA.
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent ae970dc0
...@@ -56,7 +56,7 @@ EXPORT_SYMBOL(physvirt_offset); ...@@ -56,7 +56,7 @@ EXPORT_SYMBOL(physvirt_offset);
struct page *vmemmap __ro_after_init; struct page *vmemmap __ro_after_init;
EXPORT_SYMBOL(vmemmap); EXPORT_SYMBOL(vmemmap);
phys_addr_t arm64_dma_phys_limit __ro_after_init; phys_addr_t arm64_dma32_phys_limit __ro_after_init;
#ifdef CONFIG_KEXEC_CORE #ifdef CONFIG_KEXEC_CORE
/* /*
...@@ -174,7 +174,7 @@ static void __init reserve_elfcorehdr(void) ...@@ -174,7 +174,7 @@ static void __init reserve_elfcorehdr(void)
* currently assumes that for memory starting above 4G, 32-bit devices will * currently assumes that for memory starting above 4G, 32-bit devices will
* use a DMA offset. * use a DMA offset.
*/ */
static phys_addr_t __init max_zone_dma_phys(void) static phys_addr_t __init max_zone_dma32_phys(void)
{ {
phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32); phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32);
return min(offset + (1ULL << 32), memblock_end_of_DRAM()); return min(offset + (1ULL << 32), memblock_end_of_DRAM());
...@@ -187,7 +187,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) ...@@ -187,7 +187,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
unsigned long max_zone_pfns[MAX_NR_ZONES] = {0}; unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
#ifdef CONFIG_ZONE_DMA32 #ifdef CONFIG_ZONE_DMA32
max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma_phys_limit); max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma32_phys_limit);
#endif #endif
max_zone_pfns[ZONE_NORMAL] = max; max_zone_pfns[ZONE_NORMAL] = max;
...@@ -200,16 +200,16 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) ...@@ -200,16 +200,16 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
{ {
struct memblock_region *reg; struct memblock_region *reg;
unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
unsigned long max_dma = min; unsigned long max_dma32 = min;
memset(zone_size, 0, sizeof(zone_size)); memset(zone_size, 0, sizeof(zone_size));
/* 4GB maximum for 32-bit only capable devices */ /* 4GB maximum for 32-bit only capable devices */
#ifdef CONFIG_ZONE_DMA32 #ifdef CONFIG_ZONE_DMA32
max_dma = PFN_DOWN(arm64_dma_phys_limit); max_dma32 = PFN_DOWN(arm64_dma32_phys_limit);
zone_size[ZONE_DMA32] = max_dma - min; zone_size[ZONE_DMA32] = max_dma32 - min;
#endif #endif
zone_size[ZONE_NORMAL] = max - max_dma; zone_size[ZONE_NORMAL] = max - max_dma32;
memcpy(zhole_size, zone_size, sizeof(zhole_size)); memcpy(zhole_size, zone_size, sizeof(zhole_size));
...@@ -221,14 +221,14 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) ...@@ -221,14 +221,14 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
continue; continue;
#ifdef CONFIG_ZONE_DMA32 #ifdef CONFIG_ZONE_DMA32
if (start < max_dma) { if (start < max_dma32) {
unsigned long dma_end = min(end, max_dma); unsigned long dma_end = min(end, max_dma32);
zhole_size[ZONE_DMA32] -= dma_end - start; zhole_size[ZONE_DMA32] -= dma_end - start;
} }
#endif #endif
if (end > max_dma) { if (end > max_dma32) {
unsigned long normal_end = min(end, max); unsigned long normal_end = min(end, max);
unsigned long normal_start = max(start, max_dma); unsigned long normal_start = max(start, max_dma32);
zhole_size[ZONE_NORMAL] -= normal_end - normal_start; zhole_size[ZONE_NORMAL] -= normal_end - normal_start;
} }
} }
...@@ -420,9 +420,9 @@ void __init arm64_memblock_init(void) ...@@ -420,9 +420,9 @@ void __init arm64_memblock_init(void)
/* 4GB maximum for 32-bit only capable devices */ /* 4GB maximum for 32-bit only capable devices */
if (IS_ENABLED(CONFIG_ZONE_DMA32)) if (IS_ENABLED(CONFIG_ZONE_DMA32))
arm64_dma_phys_limit = max_zone_dma_phys(); arm64_dma32_phys_limit = max_zone_dma32_phys();
else else
arm64_dma_phys_limit = PHYS_MASK + 1; arm64_dma32_phys_limit = PHYS_MASK + 1;
reserve_crashkernel(); reserve_crashkernel();
...@@ -430,7 +430,7 @@ void __init arm64_memblock_init(void) ...@@ -430,7 +430,7 @@ void __init arm64_memblock_init(void)
high_memory = __va(memblock_end_of_DRAM() - 1) + 1; high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
dma_contiguous_reserve(arm64_dma_phys_limit); dma_contiguous_reserve(arm64_dma32_phys_limit);
} }
void __init bootmem_init(void) void __init bootmem_init(void)
...@@ -534,7 +534,7 @@ static void __init free_unused_memmap(void) ...@@ -534,7 +534,7 @@ static void __init free_unused_memmap(void)
void __init mem_init(void) void __init mem_init(void)
{ {
if (swiotlb_force == SWIOTLB_FORCE || if (swiotlb_force == SWIOTLB_FORCE ||
max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT)) max_pfn > (arm64_dma32_phys_limit >> PAGE_SHIFT))
swiotlb_init(1); swiotlb_init(1);
else else
swiotlb_force = SWIOTLB_NO_FORCE; swiotlb_force = SWIOTLB_NO_FORCE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment