diff options
author | Hanjun Guo <hanjun.guo@linaro.org> | 2016-05-24 18:35:36 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-30 08:27:07 -0400 |
commit | 8ccbbdaa2bc06f7b11fec7f44bf2501786a189ba (patch) | |
tree | 04da55bf0ee0278fcb507859ad7a644a4233c151 | |
parent | 6525afdf53b39968f1a109b1ce1607ca6c98d300 (diff) |
arm64, NUMA: rework numa_add_memblk()
Rework numa_add_memblk() to update the parameter "u64 size" to "u64
end", this will make it consistent with x86 and simplifies the arm64
ACPI NUMA code to be added later.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: David Daney <david.daney@cavium.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | arch/arm64/mm/numa.c | 12 | ||||
-rw-r--r-- | drivers/of/of_numa.c | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 98dc1047f2a2..6cb03f9c904d 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c | |||
@@ -131,25 +131,25 @@ void __init early_map_cpu_to_node(unsigned int cpu, int nid) | |||
131 | * numa_add_memblk - Set node id to memblk | 131 | * numa_add_memblk - Set node id to memblk |
132 | * @nid: NUMA node ID of the new memblk | 132 | * @nid: NUMA node ID of the new memblk |
133 | * @start: Start address of the new memblk | 133 | * @start: Start address of the new memblk |
134 | * @size: Size of the new memblk | 134 | * @end: End address of the new memblk |
135 | * | 135 | * |
136 | * RETURNS: | 136 | * RETURNS: |
137 | * 0 on success, -errno on failure. | 137 | * 0 on success, -errno on failure. |
138 | */ | 138 | */ |
139 | int __init numa_add_memblk(int nid, u64 start, u64 size) | 139 | int __init numa_add_memblk(int nid, u64 start, u64 end) |
140 | { | 140 | { |
141 | int ret; | 141 | int ret; |
142 | 142 | ||
143 | ret = memblock_set_node(start, size, &memblock.memory, nid); | 143 | ret = memblock_set_node(start, (end - start), &memblock.memory, nid); |
144 | if (ret < 0) { | 144 | if (ret < 0) { |
145 | pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n", | 145 | pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n", |
146 | start, (start + size - 1), nid); | 146 | start, (end - 1), nid); |
147 | return ret; | 147 | return ret; |
148 | } | 148 | } |
149 | 149 | ||
150 | node_set(nid, numa_nodes_parsed); | 150 | node_set(nid, numa_nodes_parsed); |
151 | pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n", | 151 | pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n", |
152 | start, (start + size - 1), nid); | 152 | start, (end - 1), nid); |
153 | return ret; | 153 | return ret; |
154 | } | 154 | } |
155 | 155 | ||
@@ -367,7 +367,7 @@ static int __init dummy_numa_init(void) | |||
367 | 0LLU, PFN_PHYS(max_pfn) - 1); | 367 | 0LLU, PFN_PHYS(max_pfn) - 1); |
368 | 368 | ||
369 | for_each_memblock(memory, mblk) { | 369 | for_each_memblock(memory, mblk) { |
370 | ret = numa_add_memblk(0, mblk->base, mblk->size); | 370 | ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size); |
371 | if (!ret) | 371 | if (!ret) |
372 | continue; | 372 | continue; |
373 | 373 | ||
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 0f2784bc1874..ed5a097f0801 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c | |||
@@ -91,8 +91,8 @@ static int __init of_numa_parse_memory_nodes(void) | |||
91 | pr_debug("NUMA: base = %llx len = %llx, node = %u\n", | 91 | pr_debug("NUMA: base = %llx len = %llx, node = %u\n", |
92 | rsrc.start, rsrc.end - rsrc.start + 1, nid); | 92 | rsrc.start, rsrc.end - rsrc.start + 1, nid); |
93 | 93 | ||
94 | r = numa_add_memblk(nid, rsrc.start, | 94 | |
95 | rsrc.end - rsrc.start + 1); | 95 | r = numa_add_memblk(nid, rsrc.start, rsrc.end + 1); |
96 | if (r) | 96 | if (r) |
97 | break; | 97 | break; |
98 | } | 98 | } |