]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc64/ftrace: Delay enabling ftrace on secondary cpus
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 19 Apr 2018 07:04:03 +0000 (12:34 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 May 2018 12:32:26 +0000 (22:32 +1000)
commitac84b52e7c2d0c793eb0189710463b09e371e6dd
treeda6d219827c997a1da87e124711c19d899bbe418
parent00b0f7b8e30c69bb2cbb1e28a2ccf51ee017ebea
powerpc64/ftrace: Delay enabling ftrace on secondary cpus

On the boot cpu, though we enable paca->ftrace_enabled in early_setup()
(via cpu_ready_for_interrupts()), we don't start tracing until much
later since ftrace is not initialized yet and since we only support
DYNAMIC_FTRACE on powerpc. However, it is possible that ftrace has been
initialized by the time some of the secondary cpus start up. In this
case, we will try to trace some of the early boot code which can cause
problems.

To address this, move setting paca->ftrace_enabled from
cpu_ready_for_interrupts() to early_setup() for the boot cpu, and towards
the end of start_secondary() for secondary cpus.

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/setup_64.c
arch/powerpc/kernel/smp.c