All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH] cpu_hotplug on IBM JS20 system
@ 2006-11-13 13:10 Srinivasa Ds
  2006-11-13 13:09 ` Heiko Carstens
  2006-11-13 21:39 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 10+ messages in thread
From: Srinivasa Ds @ 2006-11-13 13:10 UTC (permalink / raw)
  To: anton, paulus; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]

Hi
when I tried to hot plug a cpu on IBM bladecentre JS20 system,it dropped 
in to xmon. On analyzing the problem,I found out that "self-stop" token  
is not exported
to the OS through rtas(Could be verified by looking in to 
/proc/device-tree/rtas file).

1:mon> e
cpu 0x1: Vector: 700 (Program Check) at [c00000000ff1bab0]
   pc: c00000000001b144: .rtas_stop_self+0x34/0x70
   lr: c0000000000439c0: .pSeries_mach_cpu_die+0x34/0x40
   sp: c00000000ff1bd30
  msr: 8000000000021032
 current = 0xc00000000ff050b0
 paca    = 0xc0000000005ec500
   pid   = 0, comm = swapper
kernel BUG in rtas_stop_self at arch/powerpc/kernel/rtas.c:829!
===========================================
void rtas_stop_self(void)
{
       struct rtas_args *rtas_args = &rtas_stop_self_args;

       local_irq_disable();

       BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE);
===================================================
#ifdef CONFIG_HOTPLUG_CPU
       rtas_stop_self_args.token = rtas_token("stop-self");
#endif /* CONFIG_HOTPLUG_CPU */
#ifdef CONFIG_RTAS_ERROR_LOGGING
       rtas_last_error_token = rtas_token("rtas-last-error");
===================================================

Since we are not supported by hardware for cpu hotplug. I have developed 
the patch which will disable cpu hotplug on IBM bladecentre JS20. Please 
let me know your comments on this please.

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>




Thanks
Srinivasa DS



[-- Attachment #2: cpu_hotplug.fix --]
[-- Type: text/plain, Size: 1839 bytes --]

 arch/powerpc/kernel/rtas.c |    9 +++++++++
 kernel/cpu.c               |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

Index: linux-2.6.19-rc5/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.19-rc5.orig/arch/powerpc/kernel/rtas.c	2006-11-08 07:54:20.000000000 +0530
+++ linux-2.6.19-rc5/arch/powerpc/kernel/rtas.c	2006-11-13 17:39:10.000000000 +0530
@@ -53,6 +53,9 @@
 
 unsigned long rtas_rmo_buf;
 
+extern  int cpu_hotplug_disabled;
+extern  struct mutex cpu_add_remove_lock;
+
 /*
  * If non-NULL, this gets called when the kernel terminates.
  * This is done like this so rtas_flash can be a module.
@@ -881,6 +884,12 @@
 
 #ifdef CONFIG_HOTPLUG_CPU
 	rtas_stop_self_args.token = rtas_token("stop-self");
+	if(rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE) {
+		mutex_lock(&cpu_add_remove_lock);
+		cpu_hotplug_disabled = 1;
+		mutex_unlock(&cpu_add_remove_lock);
+	}
+
 #endif /* CONFIG_HOTPLUG_CPU */
 #ifdef CONFIG_RTAS_ERROR_LOGGING
 	rtas_last_error_token = rtas_token("rtas-last-error");
Index: linux-2.6.19-rc5/kernel/cpu.c
===================================================================
--- linux-2.6.19-rc5.orig/kernel/cpu.c	2006-11-08 07:54:20.000000000 +0530
+++ linux-2.6.19-rc5/kernel/cpu.c	2006-11-13 17:36:22.000000000 +0530
@@ -16,7 +16,7 @@
 #include <linux/mutex.h>
 
 /* This protects CPUs going up and down... */
-static DEFINE_MUTEX(cpu_add_remove_lock);
+DEFINE_MUTEX(cpu_add_remove_lock);
 static DEFINE_MUTEX(cpu_bitmask_lock);
 
 static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain);
@@ -24,7 +24,7 @@
 /* If set, cpu_up and cpu_down will return -EBUSY and do nothing.
  * Should always be manipulated under cpu_add_remove_lock
  */
-static int cpu_hotplug_disabled;
+int cpu_hotplug_disabled;
 
 #ifdef CONFIG_HOTPLUG_CPU
 

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

end of thread, other threads:[~2006-11-15  4:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13 13:10 [RFC] [PATCH] cpu_hotplug on IBM JS20 system Srinivasa Ds
2006-11-13 13:09 ` Heiko Carstens
2006-11-13 15:37   ` Gautham R Shenoy
2006-11-13 21:39 ` Benjamin Herrenschmidt
2006-11-14 13:37   ` Srinivasa Ds
2006-11-14 14:14     ` Srinivasa Ds
2006-11-15  2:58     ` Michael Ellerman
2006-11-15  2:58       ` Michael Ellerman
2006-11-15  4:50       ` Srinivasa Ds
2006-11-15  4:50         ` Srinivasa Ds

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.