diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-28 14:31:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-28 14:31:06 -0400 |
commit | b92d9648edcc56baf537afe491b228f158b68fcb (patch) | |
tree | b01783824b67f67ab6c1a6af5ba1ba09167be220 | |
parent | c38c04c630a5fb626e93b7530671a67feab9596c (diff) | |
parent | 3fa72fe9c614717d22ae75b84d45f41da65c10fe (diff) |
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon:
"Three arm64 fixes for -rc3. They're all pretty straightforward: a
couple of NUMA issues from the Huawei folks and a thinko in
__page_to_voff that seems to be benign, but is certainly better off
fixed.
Summary:
- couple of NUMA fixes
- thinko in __page_to_voff"
* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: mm: fix __page_to_voff definition
arm64/numa: fix incorrect log for memory-less node
arm64/numa: fix pcpu_cpu_distance() to get correct CPU proximity
-rw-r--r-- | arch/arm64/include/asm/memory.h | 2 | ||||
-rw-r--r-- | arch/arm64/mm/numa.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index ba62df8c6e35..b71086d25195 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
@@ -217,7 +217,7 @@ static inline void *phys_to_virt(phys_addr_t x) | |||
217 | #define _virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 217 | #define _virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
218 | #else | 218 | #else |
219 | #define __virt_to_pgoff(kaddr) (((u64)(kaddr) & ~PAGE_OFFSET) / PAGE_SIZE * sizeof(struct page)) | 219 | #define __virt_to_pgoff(kaddr) (((u64)(kaddr) & ~PAGE_OFFSET) / PAGE_SIZE * sizeof(struct page)) |
220 | #define __page_to_voff(kaddr) (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page)) | 220 | #define __page_to_voff(page) (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page)) |
221 | 221 | ||
222 | #define page_to_virt(page) ((void *)((__page_to_voff(page)) | PAGE_OFFSET)) | 222 | #define page_to_virt(page) ((void *)((__page_to_voff(page)) | PAGE_OFFSET)) |
223 | #define virt_to_page(vaddr) ((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START)) | 223 | #define virt_to_page(vaddr) ((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START)) |
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 778a985c8a70..4b32168cf91a 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c | |||
@@ -147,7 +147,7 @@ static int __init early_cpu_to_node(int cpu) | |||
147 | 147 | ||
148 | static int __init pcpu_cpu_distance(unsigned int from, unsigned int to) | 148 | static int __init pcpu_cpu_distance(unsigned int from, unsigned int to) |
149 | { | 149 | { |
150 | return node_distance(from, to); | 150 | return node_distance(early_cpu_to_node(from), early_cpu_to_node(to)); |
151 | } | 151 | } |
152 | 152 | ||
153 | static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, | 153 | static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, |
@@ -223,8 +223,11 @@ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) | |||
223 | void *nd; | 223 | void *nd; |
224 | int tnid; | 224 | int tnid; |
225 | 225 | ||
226 | pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n", | 226 | if (start_pfn < end_pfn) |
227 | nid, start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1); | 227 | pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n", nid, |
228 | start_pfn << PAGE_SHIFT, (end_pfn << PAGE_SHIFT) - 1); | ||
229 | else | ||
230 | pr_info("Initmem setup node %d [<memory-less node>]\n", nid); | ||
228 | 231 | ||
229 | nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); | 232 | nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); |
230 | nd = __va(nd_pa); | 233 | nd = __va(nd_pa); |