linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / powerpc / platforms / pseries / xics.c
index 9ff7105..fd823c7 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/gfp.h>
 #include <linux/radix-tree.h>
 #include <linux/cpu.h>
-#include <asm/firmware.h>
 #include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
@@ -168,7 +167,7 @@ static int pSeriesLP_xirr_info_get(int n_cpu)
        unsigned long return_value;
 
        lpar_rc = plpar_xirr(&return_value);
-       if (lpar_rc != H_SUCCESS)
+       if (lpar_rc != H_Success)
                panic(" bad return code xirr - rc = %lx \n", lpar_rc);
        return (int)return_value;
 }
@@ -179,7 +178,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
        unsigned long val64 = value & 0xffffffff;
 
        lpar_rc = plpar_eoi(val64);
-       if (lpar_rc != H_SUCCESS)
+       if (lpar_rc != H_Success)
                panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
                      val64);
 }
@@ -189,7 +188,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
        unsigned long lpar_rc;
 
        lpar_rc = plpar_cppr(value);
-       if (lpar_rc != H_SUCCESS)
+       if (lpar_rc != H_Success)
                panic("bad return code cppr - rc = %lx\n", lpar_rc);
 }
 
@@ -198,7 +197,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
        unsigned long lpar_rc;
 
        lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
-       if (lpar_rc != H_SUCCESS)
+       if (lpar_rc != H_Success)
                panic("bad return code qirr - rc = %lx\n", lpar_rc);
 }
 
@@ -500,7 +499,7 @@ nextnode:
             np;
             np = of_find_node_by_type(np, "cpu")) {
                ireg = (uint *)get_property(np, "reg", &ilen);
-               if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) {
+               if (ireg && ireg[0] == boot_cpuid_phys) {
                        ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s",
                                                    &ilen);
                        i = ilen / sizeof(int);
@@ -537,11 +536,11 @@ nextnode:
                of_node_put(np);
        }
 
-       if (firmware_has_feature(FW_FEATURE_LPAR))
+       if (platform_is_lpar())
                ops = &pSeriesLP_ops;
        else {
 #ifdef CONFIG_SMP
-               for_each_possible_cpu(i) {
+               for_each_cpu(i) {
                        int hard_id;
 
                        /* FIXME: Do this dynamically! --RR */
@@ -641,28 +640,23 @@ void xics_teardown_cpu(int secondary)
        ops->cppr_info(cpu, 0x00);
        iosync();
 
-       /*
-        * Clear IPI
-        */
-       ops->qirr_info(cpu, 0xff);
-       /*
-        * we need to EOI the IPI if we got here from kexec down IPI
-        *
-        * probably need to check all the other interrupts too
-        * should we be flagging idle loop instead?
-        * or creating some task to be scheduled?
-        */
-       ops->xirr_info_set(cpu, XICS_IPI);
-
        /*
         * Some machines need to have at least one cpu in the GIQ,
         * so leave the master cpu in the group.
         */
-       if (secondary) 
+       if (secondary) {
+               /*
+                * we need to EOI the IPI if we got here from kexec down IPI
+                *
+                * probably need to check all the other interrupts too
+                * should we be flagging idle loop instead?
+                * or creating some task to be scheduled?
+                */
+               ops->xirr_info_set(cpu, XICS_IPI);
                rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
                        (1UL << interrupt_server_size) - 1 -
                        default_distrib_server, 0);
-       
+       }
 }
 
 #ifdef CONFIG_HOTPLUG_CPU