Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=674fa677c01ad0b90237f5cddc8d68502fea5156
Commit:     674fa677c01ad0b90237f5cddc8d68502fea5156
Parent:     413f7c405a342b0b9370ea7a652b9f0270183bf3
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 5 17:52:38 2006 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Dec 8 15:55:55 2006 +1100

    [POWERPC] Only enable cpu hotplug via RTAS if the required firmware support 
is found
    
    To support cpu hotplug on pseries we require two RTAS tokens.  The cpu
    hotplug machinery should only be wired up if these tokens are found in
    the device tree.
    
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c 
b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 12864d7..e78e8ac 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -64,6 +64,8 @@ static void pSeries_mach_cpu_die(void)
        for(;;);
 }
 
+static int qcss_tok;   /* query-cpu-stopped-state token */
+
 /* Get state of physical CPU.
  * Return codes:
  *     0       - The processor is in the RTAS stopped state
@@ -74,12 +76,8 @@ static void pSeries_mach_cpu_die(void)
  */
 static int query_cpu_stopped(unsigned int pcpu)
 {
-       int cpu_status;
-       int status, qcss_tok;
+       int cpu_status, status;
 
-       qcss_tok = rtas_token("query-cpu-stopped-state");
-       if (qcss_tok == RTAS_UNKNOWN_SERVICE)
-               return -1;
        status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
        if (status != 0) {
                printk(KERN_ERR
@@ -254,9 +252,16 @@ static struct notifier_block pSeries_smp_nb = {
 static int __init pseries_cpu_hotplug_init(void)
 {
        rtas_stop_self_args.token = rtas_token("stop-self");
+       qcss_tok = rtas_token("query-cpu-stopped-state");
 
-       ppc_md.cpu_die = pSeries_mach_cpu_die;
+       if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE ||
+                       qcss_tok == RTAS_UNKNOWN_SERVICE) {
+               printk(KERN_INFO "CPU Hotplug not supported by firmware "
+                               "- disabling.\n");
+               return 0;
+       }
 
+       ppc_md.cpu_die = pSeries_mach_cpu_die;
        smp_ops->cpu_disable = pSeries_cpu_disable;
        smp_ops->cpu_die = pSeries_cpu_die;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to