lkml.org 
[lkml]   [2016]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[DEBUG 05/12] powerpc/mm: Identify coherent device memory nodes during platform init
Date
Coherent device memory nodes will have "ibm,hotplug-aperture" as one of the
compatible properties in their respective device nodes in the device tree.
Detect them early during NUMA platform initialization and mark them as such
in the node_to_phys_device_map[] array which in turn is used to support the
arch_check_cdm_node() function for the core VM.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
arch/powerpc/mm/numa.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 31efc27..b625e0e 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -41,10 +41,12 @@
#include <asm/setup.h>
#include <asm/vdso.h>

+static int node_to_phys_device_map[MAX_NUMNODES];
+
#ifdef CONFIG_COHERENT_DEVICE
int arch_check_node_cdm(int nid)
{
- return 0;
+ return node_to_phys_device_map[nid];
}
#endif

@@ -790,6 +792,9 @@ static int __init parse_numa_properties(void)
if (nid < 0)
nid = default_nid;

+ if (of_device_is_compatible(memory, "ibm,hotplug-aperture"))
+ node_to_phys_device_map[nid] = 1;
+
fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
node_set_online(nid);

--
1.8.3.1
\
 
 \ /
  Last update: 2016-11-22 15:23    [W:0.138 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site