]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
powerpc64/ftrace: Disable ftrace during hotplug
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 19 Apr 2018 07:04:04 +0000 (12:34 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 May 2018 12:32:27 +0000 (22:32 +1000)
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.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/smp.c

index 9e711cdbe3847ecda5c5b6c7d2087c2424119780..c96f8fbc19423ab39956dde4b519ccb25ac798c0 100644 (file)
@@ -1166,6 +1166,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;
@@ -1184,6 +1186,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();