public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip, gicv3-its, numa: Enable Cavium ThunderX #23144 workaround for ACPI
@ 2016-05-02 16:38 Robert Richter
  2016-05-03  7:40 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Richter @ 2016-05-02 16:38 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier
  Cc: Will Deacon, Tomasz Nowicki, David Daney, Ashok Kumar,
	Robert Richter, linux-kernel

From: Robert Richter <rrichter@cavium.com>

In case of acpi the firmware does not provide node ids for cpus and
its devices. Determine it from system topology special to Cavium
ThunderX systems. This enables #23144 workaround for ACPI.

Signed-off-by: Robert Richter <rrichter@cavium.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 494395274cf7..6eac0f3c1e56 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1107,11 +1107,13 @@ static void its_cpu_init_collection(void)
 
 		/* avoid cross node collections and its mapping */
 		if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) {
-			struct device_node *cpu_node;
-
-			cpu_node = of_get_cpu_node(cpu, NULL);
+			int nid = of_node_to_nid(of_get_cpu_node(cpu, NULL));
+			if (nid == NUMA_NO_NODE) {
+				pr_warn_once("ITS: Updating cpu numa node ids\n");
+				nid = MPIDR_AFFINITY_LEVEL(read_cpuid_mpidr(), 2);
+			}
 			if (its->numa_node != NUMA_NO_NODE &&
-				its->numa_node != of_node_to_nid(cpu_node))
+				its->numa_node != nid)
 				continue;
 		}
 
@@ -1443,6 +1445,15 @@ static void __maybe_unused its_enable_quirk_cavium_23144(void *data)
 {
 	struct its_node *its = data;
 
+	if (!IS_ENABLED(CONFIG_NUMA))
+		return;
+
+	if (its->numa_node == NUMA_NO_NODE) {
+		/* make ACPI work */
+		its->numa_node = (its->phys_base >> 44) & 0x3;
+		pr_warn_once("ITS: Updating ITS numa node ids\n");
+	}
+
 	its->flags |= ITS_FLAGS_WORKAROUND_CAVIUM_23144;
 }
 
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-11 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-02 16:38 [PATCH] irqchip, gicv3-its, numa: Enable Cavium ThunderX #23144 workaround for ACPI Robert Richter
2016-05-03  7:40 ` Marc Zyngier
2016-05-11 16:27   ` Robert Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox