Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com>
To: <linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-pci@vger.kernel.org>, <linux-ia64@vger.kernel.org>,
	<linux-metag@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
	<linux-s390@vger.kernel.org>, <linux-sh@vger.kernel.org>,
	<linux-arch@vger.kernel.org>, <Will.Deacon@arm.com>,
	<catalin.marinas@arm.com>, <robh+dt@kernel.org>,
	<mark.rutland@arm.com>, <grant.likely@linaro.org>,
	<leif.lindholm@linaro.org>, <rfranz@cavium.com>,
	<ard.biesheuvel@linaro.org>, <msalter@redhat.com>,
	<steve.capper@linaro.org>, <hanjun.guo@linaro.org>,
	<al.stone@linaro.org>, <arnd@arndb.de>, <pawel.moll@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
	<rjw@rjwysocki.net>, <lenb@kernel.org>, <marc.zyngier@arm.com>,
	<lorenzo.pieralisi@arm.com>, <bhelgaas@google.com>,
	<tony.luck@intel.com>, <fenghua.yu@intel.com>,
	<james.hogan@imgtec.com>, <benh@kernel.crashing.org>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
	<x86@kernel.org>, <jonathan@jonmasters.org>,
	<rrichter@cavium.com>, <Prasun.Kapoor@caviumnetworks.com>
Cc: <gpkulkarni@gmail.com>
Subject: [PATCH v10 4/8] arm64, numa : Enable numa dt for arm64 platforms.
Date: Tue, 2 Feb 2016 15:39:19 +0530	[thread overview]
Message-ID: <1454407763-1017-5-git-send-email-gkulkarni@caviumnetworks.com> (raw)
In-Reply-To: <1454407763-1017-1-git-send-email-gkulkarni@caviumnetworks.com>

Adding numa dt binding support for arm64 based platforms.

Reviewed-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com>
---
 arch/arm64/include/asm/numa.h |  2 ++
 arch/arm64/kernel/smp.c       |  2 ++
 arch/arm64/mm/numa.c          | 17 +++++++++++++++++
 3 files changed, 21 insertions(+)

diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h
index 574267f..e9b4f29 100644
--- a/arch/arm64/include/asm/numa.h
+++ b/arch/arm64/include/asm/numa.h
@@ -31,12 +31,14 @@ void __init arm64_numa_init(void);
 int __init numa_add_memblk(int nodeid, u64 start, u64 end);
 void __init numa_set_distance(int from, int to, int distance);
 void __init numa_free_distance(void);
+void __init early_map_cpu_to_node(unsigned int cpu, int nid);
 void numa_store_cpu_info(unsigned int cpu);
 
 #else	/* CONFIG_NUMA */
 
 static inline void numa_store_cpu_info(unsigned int cpu) { }
 static inline void arm64_numa_init(void) { }
+static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { }
 
 #endif	/* CONFIG_NUMA */
 
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index d6e7d6a..46c45c8 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -520,6 +520,8 @@ static void __init of_parse_and_init_cpus(void)
 
 		pr_debug("cpu logical map 0x%llx\n", hwid);
 		cpu_logical_map(cpu_count) = hwid;
+
+		early_map_cpu_to_node(cpu_count, of_node_to_nid(dn));
 next:
 		cpu_count++;
 	}
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 60f19a2..7aad5d4 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -20,6 +20,7 @@
 #include <linux/bootmem.h>
 #include <linux/memblock.h>
 #include <linux/module.h>
+#include <linux/of.h>
 
 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
 EXPORT_SYMBOL(node_data);
@@ -122,6 +123,15 @@ void numa_store_cpu_info(unsigned int cpu)
 	map_cpu_to_node(cpu, numa_off ? 0 : cpu_to_node_map[cpu]);
 }
 
+void __init early_map_cpu_to_node(unsigned int cpu, int nid)
+{
+	/* fallback to node 0 */
+	if (nid < 0 || nid >= MAX_NUMNODES)
+		nid = 0;
+
+	cpu_to_node_map[cpu] = nid;
+}
+
 /**
  * numa_add_memblk - Set node id to memblk
  * @nid: NUMA node ID of the new memblk
@@ -383,5 +393,12 @@ static int __init dummy_numa_init(void)
  */
 void __init arm64_numa_init(void)
 {
+	if (!numa_off) {
+#ifdef CONFIG_OF_NUMA
+		if (!numa_init(of_numa_init))
+			return;
+#endif
+	}
+
 	numa_init(dummy_numa_init);
 }
-- 
1.8.1.4


  parent reply	other threads:[~2016-02-02 10:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 10:09 [PATCH v10 0/8] arm64, numa: Add numa support for arm64 platforms Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 1/8] arm64, numa: adding " Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 2/8] Documentation, dt, numa: dt bindings for numa Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 3/8] dt, numa: adding numa dt binding implementation Ganapatrao Kulkarni
2016-02-02 23:34   ` Rob Herring
2016-02-04 11:15     ` Ganapatrao Kulkarni
2016-02-11 14:50   ` Rob Herring
2016-02-11 15:32     ` Robert Richter
2016-02-11 15:58       ` Ganapatrao Kulkarni
2016-02-02 10:09 ` Ganapatrao Kulkarni [this message]
2016-02-02 10:09 ` [PATCH v10 5/8] arm64, dt, thunderx: Add initial dts for Cavium Thunderx in 2 node topology Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 6/8] arm64, mm, numa: Adding numa balancing support for arm64 Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 7/8] topology, cleanup: Avoid redefinition of cpumask_of_pcibus in asm header files Ganapatrao Kulkarni
2016-02-02 10:09 ` [PATCH v10 8/8] numa, mm, cleanup: remove redundant NODE_DATA macro from " Ganapatrao Kulkarni
2016-02-07  8:40   ` kbuild test robot
2016-02-02 11:26 ` [PATCH v10 0/8] arm64, numa: Add numa support for arm64 platforms Robert Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454407763-1017-5-git-send-email-gkulkarni@caviumnetworks.com \
    --to=gkulkarni@caviumnetworks.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=Will.Deacon@arm.com \
    --cc=al.stone@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=galak@codeaurora.org \
    --cc=gpkulkarni@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=hanjun.guo@linaro.org \
    --cc=hpa@zytor.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=james.hogan@imgtec.com \
    --cc=jonathan@jonmasters.org \
    --cc=leif.lindholm@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-metag@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=msalter@redhat.com \
    --cc=pawel.moll@arm.com \
    --cc=rfranz@cavium.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=rrichter@cavium.com \
    --cc=steve.capper@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox