Disable ftrace when a cpu is about to go offline. When the cpu is woken
up, ftrace will get enabled in start_secondary().

Signed-off-by: Naveen N. Rao <naveen.n....@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/smp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index d90195dddc57..09a7ef12ff33 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1122,6 +1122,8 @@ int __cpu_disable(void)
        if (!smp_ops->cpu_disable)
                return -ENOSYS;
 
+       this_cpu_disable_ftrace();
+
        err = smp_ops->cpu_disable();
        if (err)
                return err;
@@ -1140,6 +1142,12 @@ void __cpu_die(unsigned int cpu)
 
 void cpu_die(void)
 {
+       /*
+        * Disable on the down path. This will be re-enabled by
+        * start_secondary() via start_secondary_resume() below
+        */
+       this_cpu_disable_ftrace();
+
        if (ppc_md.cpu_die)
                ppc_md.cpu_die();
 
-- 
2.16.2

Reply via email to