3039bfe822e825e1736e38e21489fdadab625837
[openwrt/staging/981213.git] /
1 From 4d2bd7f66bac81b042afc2a6e742bd776a5a3938 Mon Sep 17 00:00:00 2001
2 From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
3 Date: Wed, 11 Sep 2019 20:25:44 +0200
4 Subject: [PATCH] arm64: rename variables used to calculate
5 ZONE_DMA32's size
6
7 commit a573cdd7973dedd87e62196c400332896bb236c8 upstream.
8
9 Let the name indicate that they are used to calculate ZONE_DMA32's size
10 as opposed to ZONE_DMA.
11
12 Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
13 Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
14 Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
15 ---
16 arch/arm64/mm/init.c | 30 +++++++++++++++---------------
17 1 file changed, 15 insertions(+), 15 deletions(-)
18
19 --- a/arch/arm64/mm/init.c
20 +++ b/arch/arm64/mm/init.c
21 @@ -56,7 +56,7 @@ EXPORT_SYMBOL(physvirt_offset);
22 struct page *vmemmap __ro_after_init;
23 EXPORT_SYMBOL(vmemmap);
24
25 -phys_addr_t arm64_dma_phys_limit __ro_after_init;
26 +phys_addr_t arm64_dma32_phys_limit __ro_after_init;
27
28 #ifdef CONFIG_KEXEC_CORE
29 /*
30 @@ -174,7 +174,7 @@ static void __init reserve_elfcorehdr(vo
31 * currently assumes that for memory starting above 4G, 32-bit devices will
32 * use a DMA offset.
33 */
34 -static phys_addr_t __init max_zone_dma_phys(void)
35 +static phys_addr_t __init max_zone_dma32_phys(void)
36 {
37 phys_addr_t offset = memblock_start_of_DRAM() & GENMASK_ULL(63, 32);
38 return min(offset + (1ULL << 32), memblock_end_of_DRAM());
39 @@ -187,7 +187,7 @@ static void __init zone_sizes_init(unsig
40 unsigned long max_zone_pfns[MAX_NR_ZONES] = {0};
41
42 #ifdef CONFIG_ZONE_DMA32
43 - max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma_phys_limit);
44 + max_zone_pfns[ZONE_DMA32] = PFN_DOWN(arm64_dma32_phys_limit);
45 #endif
46 max_zone_pfns[ZONE_NORMAL] = max;
47
48 @@ -200,16 +200,16 @@ static void __init zone_sizes_init(unsig
49 {
50 struct memblock_region *reg;
51 unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
52 - unsigned long max_dma = min;
53 + unsigned long max_dma32 = min;
54
55 memset(zone_size, 0, sizeof(zone_size));
56
57 /* 4GB maximum for 32-bit only capable devices */
58 #ifdef CONFIG_ZONE_DMA32
59 - max_dma = PFN_DOWN(arm64_dma_phys_limit);
60 - zone_size[ZONE_DMA32] = max_dma - min;
61 + max_dma32 = PFN_DOWN(arm64_dma32_phys_limit);
62 + zone_size[ZONE_DMA32] = max_dma32 - min;
63 #endif
64 - zone_size[ZONE_NORMAL] = max - max_dma;
65 + zone_size[ZONE_NORMAL] = max - max_dma32;
66
67 memcpy(zhole_size, zone_size, sizeof(zhole_size));
68
69 @@ -221,14 +221,14 @@ static void __init zone_sizes_init(unsig
70 continue;
71
72 #ifdef CONFIG_ZONE_DMA32
73 - if (start < max_dma) {
74 - unsigned long dma_end = min(end, max_dma);
75 + if (start < max_dma32) {
76 + unsigned long dma_end = min(end, max_dma32);
77 zhole_size[ZONE_DMA32] -= dma_end - start;
78 }
79 #endif
80 - if (end > max_dma) {
81 + if (end > max_dma32) {
82 unsigned long normal_end = min(end, max);
83 - unsigned long normal_start = max(start, max_dma);
84 + unsigned long normal_start = max(start, max_dma32);
85 zhole_size[ZONE_NORMAL] -= normal_end - normal_start;
86 }
87 }
88 @@ -420,9 +420,9 @@ void __init arm64_memblock_init(void)
89
90 /* 4GB maximum for 32-bit only capable devices */
91 if (IS_ENABLED(CONFIG_ZONE_DMA32))
92 - arm64_dma_phys_limit = max_zone_dma_phys();
93 + arm64_dma32_phys_limit = max_zone_dma32_phys();
94 else
95 - arm64_dma_phys_limit = PHYS_MASK + 1;
96 + arm64_dma32_phys_limit = PHYS_MASK + 1;
97
98 reserve_crashkernel();
99
100 @@ -430,7 +430,7 @@ void __init arm64_memblock_init(void)
101
102 high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
103
104 - dma_contiguous_reserve(arm64_dma_phys_limit);
105 + dma_contiguous_reserve(arm64_dma32_phys_limit);
106 }
107
108 void __init bootmem_init(void)
109 @@ -534,7 +534,7 @@ static void __init free_unused_memmap(vo
110 void __init mem_init(void)
111 {
112 if (swiotlb_force == SWIOTLB_FORCE ||
113 - max_pfn > (arm64_dma_phys_limit >> PAGE_SHIFT))
114 + max_pfn > (arm64_dma32_phys_limit >> PAGE_SHIFT))
115 swiotlb_init(1);
116 else
117 swiotlb_force = SWIOTLB_NO_FORCE;