Thread (25 messages) flat view 25 messages, 6 authors, 2012-12-20
STALE4994d

Revision v2 of 3 in this series.

Revisions (3)
  1. v2 [diff vs current]
  2. v2 [diff vs current]
  3. v2 current

[PATCH v2 6/6] ARM: mach-virt: add SMP support using PSCI

From: Will Deacon <hidden>
Date: 2012-12-18 10:49:27

On Mon, Dec 17, 2012 at 09:45:52PM +0000, Nicolas Pitre wrote:
On Mon, 17 Dec 2012, Will Deacon wrote:
quoted
This patch adds support for SMP to mach-virt using the PSCI
infrastructure.

Signed-off-by: Will Deacon <redacted>
[...]
quoted
+/*
+ * Enumerate the possible CPU set from the device tree.
+ */
+static void __init virt_smp_init_cpus(void)
+{
+	struct device_node *dn = NULL;
+	int cpu = 0;
+
+	while ((dn = of_find_node_by_type(dn, "cpu"))) {
+		if (cpu < NR_CPUS)
+			set_cpu_possible(cpu, true);
+		cpu++;
+	}
+
+	/* sanity check */
+	if (cpu > NR_CPUS)
+		pr_warning("no. of cores (%d) greater than configured maximum "
+			   "of %d - clipping\n",
+			   cpu, NR_CPUS);
Since commit 5587164eea you shouldn't need any of the above.
There's going to be nothing left at this rate! Thanks.
quoted
+#ifdef CONFIG_SMP
+extern struct smp_operations virt_smp_ops;
+#endif
You don't need to surround prototype declaration here, unless your goal 
was to define a dummy virt_smp_ops when CONFIG_SMP is not selected?
Otherwise the reference below would break compilation.
Right you are, the smp_ops macro does the magic for us. I'll put together a
v3.

Cheers,

Will
quoted
+
 DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
 	.init_irq	= gic_init_irq,
 	.handle_irq     = gic_handle_irq,
 	.timer		= &virt_timer,
 	.init_machine	= virt_init,
+	.smp		= smp_ops(virt_smp_ops),
 	.dt_compat	= virt_dt_match,
 MACHINE_END
-- 
1.8.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help