All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Fix ordering of calls to uv_system_init & uv_cpu_init
@ 2008-09-23 13:42 Jack Steiner
  2008-09-23 14:33 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Steiner @ 2008-09-23 13:42 UTC (permalink / raw)
  To: mingo, tglx; +Cc: linux-kernel

Fix problem caused by reordering of the calls to uv_cpu_init() &
uv_system_init. Originally, uv_cpu_init() was called AFTER uv_system_init.
This order was recently broken as a side-effect of other patches.

With this patch, initialization of cpu 0 is now done by the system_init
call.

Signed-off-by: Jack Steiner <steiner@sgi.com>

---
Note. Only added a couple of lines. Most of the patch is moving uv_cpu_init()
to come earlier in the file.

Patch based on x86/tip....

 arch/x86/kernel/genx2apic_uv_x.c |   34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

Index: linux/arch/x86/kernel/genx2apic_uv_x.c
===================================================================
--- linux.orig/arch/x86/kernel/genx2apic_uv_x.c	2008-09-22 10:55:02.000000000 -0500
+++ linux/arch/x86/kernel/genx2apic_uv_x.c	2008-09-22 13:23:12.000000000 -0500
@@ -357,7 +357,22 @@ static __init void uv_rtc_init(void)
 		sn_rtc_cycles_per_second = ticks_per_sec;
 }
 
-static bool uv_system_inited;
+/*
+ * Called on each cpu to initialize the per_cpu UV data area.
+ * 	ZZZ hotplug not supported yet
+ */
+void __cpuinit uv_cpu_init(void)
+{
+	/* CPU 0 initilization will be done via uv_system_init. */
+	if (!uv_blade_info)
+		return;
+
+	uv_blade_info[uv_numa_blade_id()].nr_online_cpus++;
+
+	if (get_uv_system_type() == UV_NON_UNIQUE_APIC)
+		set_x2apic_extra_bits(uv_hub_info->pnode);
+}
+
 
 void __init uv_system_init(void)
 {
@@ -449,21 +464,6 @@ void __init uv_system_init(void)
 	map_mmr_high(max_pnode);
 	map_config_high(max_pnode);
 	map_mmioh_high(max_pnode);
-	uv_system_inited = true;
-}
 
-/*
- * Called on each cpu to initialize the per_cpu UV data area.
- * 	ZZZ hotplug not supported yet
- */
-void __cpuinit uv_cpu_init(void)
-{
-	BUG_ON(!uv_system_inited);
-
-	uv_blade_info[uv_numa_blade_id()].nr_online_cpus++;
-
-	if (get_uv_system_type() == UV_NON_UNIQUE_APIC)
-		set_x2apic_extra_bits(uv_hub_info->pnode);
+	uv_cpu_init();
 }
-
-

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

* Re: [PATCH] - Fix ordering of calls to uv_system_init & uv_cpu_init
  2008-09-23 13:42 [PATCH] - Fix ordering of calls to uv_system_init & uv_cpu_init Jack Steiner
@ 2008-09-23 14:33 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-09-23 14:33 UTC (permalink / raw)
  To: Jack Steiner; +Cc: tglx, linux-kernel, Yinghai Lu


* Jack Steiner <steiner@sgi.com> wrote:

> Fix problem caused by reordering of the calls to uv_cpu_init() &
> uv_system_init. Originally, uv_cpu_init() was called AFTER uv_system_init.
> This order was recently broken as a side-effect of other patches.
> 
> With this patch, initialization of cpu 0 is now done by the system_init
> call.
> 
> Signed-off-by: Jack Steiner <steiner@sgi.com>

applied to tip/irq/sparseirq (where this bug originates from), thanks 
Jack!

	Ingo

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

end of thread, other threads:[~2008-09-23 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 13:42 [PATCH] - Fix ordering of calls to uv_system_init & uv_cpu_init Jack Steiner
2008-09-23 14:33 ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.