linux/arch/arm/kernel
Stephen Boyd 398f74569c ARM: 8393/1: smp: Fix suspicious RCU usage with ipi tracepoints
John Stultz reports an RCU splat on boot with ARM ipi trace
events enabled.

===============================
[ INFO: suspicious RCU usage. ]
4.1.0-rc7-00033-gb5bed2f #153 Not tainted
-------------------------------
include/trace/events/ipi.h:68 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 0
RCU used illegally from extended quiescent state!
no locks held by swapper/0/0.

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.0-rc7-00033-gb5bed2f #153
Hardware name: Qualcomm (Flattened Device Tree)
[<c0216b08>] (unwind_backtrace) from [<c02136e8>] (show_stack+0x10/0x14)
[<c02136e8>] (show_stack) from [<c075e678>] (dump_stack+0x70/0xbc)
[<c075e678>] (dump_stack) from [<c0215a80>] (handle_IPI+0x428/0x604)
[<c0215a80>] (handle_IPI) from [<c020942c>] (gic_handle_irq+0x54/0x5c)
[<c020942c>] (gic_handle_irq) from [<c0766604>] (__irq_svc+0x44/0x7c)
Exception stack(0xc09f3f48 to 0xc09f3f90)
3f40:                   00000001 00000001 00000000 c09f73b8 c09f4528 c0a5de9c
3f60: c076b4f0 00000000 00000000 c09ef108 c0a5cec1 00000001 00000000 c09f3f90
3f80: c026bf60 c0210ab8 20000113 ffffffff
[<c0766604>] (__irq_svc) from [<c0210ab8>] (arch_cpu_idle+0x20/0x3c)
[<c0210ab8>] (arch_cpu_idle) from [<c02647f0>] (cpu_startup_entry+0x2c0/0x5dc)
[<c02647f0>] (cpu_startup_entry) from [<c099bc1c>] (start_kernel+0x358/0x3c4)
[<c099bc1c>] (start_kernel) from [<8020807c>] (0x8020807c)

At this point in the IPI handling path we haven't called
irq_enter() yet, so RCU doesn't know that we're about to exit
idle and properly warns that we're using RCU from an idle CPU.
Use trace_ipi_entry_rcuidle() instead of trace_ipi_entry() so
that RCU is informed about our exit from idle.

Fixes: 365ec7b173 ("ARM: add IPI tracepoints")
Reported-by: John Stultz <john.stultz@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-06-29 11:02:55 +01:00
..
.gitignore
arch_timer.c
armksyms.c ARM: 8151/1: add missing exports for asm functions required by get_user macro 2014-09-16 16:09:30 +01:00
asm-offsets.c Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
atags.h
atags_compat.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
atags_parse.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
atags_proc.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
bios32.c ARM: 8293/1: kernel: fix pci_mmap_page_range() offset calculation 2015-02-23 14:43:58 +00:00
calls.S ARM: wire up execveat syscall 2015-01-07 20:31:54 +00:00
cpuidle.c ARM: cpuidle: Document the code 2015-03-25 09:53:43 +01:00
crash_dump.c
debug.S
devtree.c
dma-isa.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
dma.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
early_printk.c
elf.c
entry-armv.S ARM: 8322/1: keep .text and .fixup regions closer together 2015-03-29 23:11:56 +01:00
entry-common.S ARM: fix missing syscall trace exit 2015-05-15 11:06:35 +01:00
entry-ftrace.S ARM: move ftrace assembly code to separate file 2014-11-21 15:25:01 +00:00
entry-header.S ARM: 8266/1: Remove early stack deallocation from restore_user_regs 2015-01-12 19:26:57 +00:00
entry-v7m.S ARM: 8295/1: fix v7M build for !CONFIG_PRINTK 2015-01-29 15:23:12 +00:00
fiq.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
fiqasm.S
ftrace.c ARM: kprobes: enable OPTPROBES for ARM 32 2015-01-13 16:10:17 +00:00
head-common.S
head-nommu.S ARM: Fix nommu booting 2015-04-21 15:26:16 +01:00
head.S ARM: 8314/1: replace PROCINFO embedded branch with relative offset 2015-03-28 15:46:14 +00:00
hibernate.c ARM: move reboot code to arch/arm/kernel/reboot.c 2015-04-02 09:50:45 +01:00
hw_breakpoint.c perf: Remove type specific target pointers 2015-03-23 10:58:04 +01:00
hyp-stub.S
insn.c
io.c ARM: io.c: clean up EXPORT_SYMBOL()s 2014-11-21 15:25:02 +00:00
irq.c ARM: 8261/1: l2c: Get outer cache .write_sec callback from mach_desc only if not NULL 2015-01-16 14:35:33 +00:00
isa.c
iwmmxt.S ARM: 8221/1: PJ4: allow building in Thumb-2 mode 2014-12-03 16:08:00 +00:00
jump_label.c ARM: kprobes: enable OPTPROBES for ARM 32 2015-01-13 16:10:17 +00:00
kgdb.c ARM: probes: move all probe code to dedicate directory 2015-01-09 09:36:50 +00:00
machine_kexec.c ARM: 8338/1: kexec: Relax SMP validation to improve DT compatibility 2015-04-02 09:59:43 +01:00
Makefile Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
module.c ARM: 8219/1: handle interworking and out-of-range relocations separately 2015-02-23 14:43:58 +00:00
opcodes.c
patch.c ARM: probes: move all probe code to dedicate directory 2015-01-09 09:36:50 +00:00
perf_callchain.c arm: perf: factor out callchain code 2014-10-30 12:16:58 +00:00
perf_event.c ARM: perf: reject groups spanning multiple hardware PMUs 2015-03-19 19:45:22 +00:00
perf_event_cpu.c ARM: 8357/1: perf: fix memory leak when probing PMU PPIs 2015-05-18 21:51:28 +01:00
perf_event_v6.c arm: perf: kill get_hw_events() 2014-10-30 12:17:00 +00:00
perf_event_v7.c ARM: perf: Add support for Scorpion PMUs 2015-03-17 18:34:01 +00:00
perf_event_xscale.c arm: perf: kill get_hw_events() 2014-10-30 12:17:00 +00:00
perf_regs.c perf: Move task_pt_regs sampling into arch code 2015-01-09 11:12:28 +01:00
pj4-cp0.c
process.c Merge branches 'misc', 'vdso' and 'fixes' into for-next 2015-04-14 22:28:25 +01:00
psci-call.S ARM: 8307/1: psci: move psci firmware calls out of line 2015-03-29 23:11:17 +01:00
psci.c ARM: 8307/1: psci: move psci firmware calls out of line 2015-03-29 23:11:17 +01:00
psci_smp.c
ptrace.c Merge git://git.infradead.org/users/eparis/audit 2014-10-19 16:25:56 -07:00
reboot.c ARM: move reboot code to arch/arm/kernel/reboot.c 2015-04-02 09:50:45 +01:00
reboot.h ARM: move reboot code to arch/arm/kernel/reboot.c 2015-04-02 09:50:45 +01:00
relocate_kernel.S
return_address.c ARM: 8328/1: remove empty preprocessor #else branch 2015-03-28 16:54:53 +00:00
setup.c Merge branches 'misc', 'vdso' and 'fixes' into for-next 2015-04-14 22:28:25 +01:00
signal.c arm: Remove signal translation and exec_domain 2015-04-12 20:58:24 +02:00
sigreturn_codes.S
sleep.S ARM: 8324/1: move cpu_resume() to .text section 2015-03-29 23:11:57 +01:00
smp.c ARM: 8393/1: smp: Fix suspicious RCU usage with ipi tracepoints 2015-06-29 11:02:55 +01:00
smp_scu.c
smp_tlb.c
smp_twd.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
stacktrace.c ARM: 8172/1: Use current_stack_pointer in save_stack_trace_tsk 2014-11-13 23:58:03 +00:00
suspend.c ARM: 8248/1: pm: remove outdated comment 2015-01-21 15:58:57 +00:00
swp_emulate.c ARM: 8322/1: keep .text and .fixup regions closer together 2015-03-29 23:11:56 +01:00
sys_arm.c
sys_oabi-compat.c separate kernel- and userland-side msghdr 2014-11-19 16:22:59 -05:00
tcm.c
thumbee.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
time.c ARM, clocksource/drivers: Provide read_boot_clock64() and read_persistent_clock64() and use them 2015-04-03 08:18:23 +02:00
topology.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00
traps.c arm: Remove signal translation and exec_domain 2015-04-12 20:58:24 +02:00
unwind.c ARM: 8176/1: Use current_stack_pointer in unwind_backtrace 2014-11-13 23:58:09 +00:00
v7m.c
vdso.c Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2015-04-14 21:03:26 -07:00
vmlinux.lds.S arm64 updates for 4.1: 2015-04-16 13:58:29 -05:00
xscale-cp0.c ARM: convert printk(KERN_* to pr_* 2014-11-21 15:24:50 +00:00