summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2017-07-03 15:33:39 +0200
committerPetr Mladek <pmladek@suse.com>2017-07-03 15:33:39 +0200
commita5707eef798b57ff5a2e56fca435dff616019b7e (patch)
treee0cbe9116abf9a87bd257e37079d175c91a50ae3 /lib
parentdc0cf5a77db9d200284f54a60994c1f6d2fbfc5f (diff)
parentf4e981cba2dec675d40ac4f270b7e8ac164c9004 (diff)
Merge branch 'for-4.13' into for-linus
Diffstat (limited to 'lib')
-rw-r--r--lib/nmi_backtrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 4e8a30d1c22f..0bc0a3535a8a 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -86,9 +86,11 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask,
bool nmi_cpu_backtrace(struct pt_regs *regs)
{
+ static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED;
int cpu = smp_processor_id();
if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
+ arch_spin_lock(&lock);
if (regs && cpu_in_idle(instruction_pointer(regs))) {
pr_warn("NMI backtrace for cpu %d skipped: idling at pc %#lx\n",
cpu, instruction_pointer(regs));
@@ -99,6 +101,7 @@ bool nmi_cpu_backtrace(struct pt_regs *regs)
else
dump_stack();
}
+ arch_spin_unlock(&lock);
cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));
return true;
}