Merge remote-tracking branch 'anton/abiv2' into next
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / platforms / powernv / smp.c
index 908672bdcea6b2c77d75763a05d10f476e2b2d75..1601a1ea02c4322cbc53f21d00b6f56c039e2276 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/cputhreads.h>
 #include <asm/xics.h>
 #include <asm/opal.h>
+#include <asm/runlatch.h>
+#include <asm/code-patching.h>
 
 #include "powernv.h"
 
@@ -49,8 +51,8 @@ static void pnv_smp_setup_cpu(int cpu)
 int pnv_smp_kick_cpu(int nr)
 {
        unsigned int pcpu = get_hard_smp_processor_id(nr);
-       unsigned long start_here = __pa(*((unsigned long *)
-                                         generic_secondary_smp_init));
+       unsigned long start_here =
+                       __pa(ppc_function_entry(generic_secondary_smp_init));
        long rc;
 
        BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -156,7 +158,9 @@ static void pnv_smp_cpu_kill_self(void)
         */
        mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
        while (!generic_check_cpu_restart(cpu)) {
+               ppc64_runlatch_off();
                power7_nap();
+               ppc64_runlatch_on();
                if (!generic_check_cpu_restart(cpu)) {
                        DBG("CPU%d Unexpected exit while offline !\n", cpu);
                        /* We may be getting an IPI, so we re-enable