summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Whitchurch <vincent.whitchurch@axis.com>2018-08-21 11:25:07 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-08-30 06:56:40 -0400
commitcb9d7fd51d9fbb329d182423bd7b92d0f8cb0e01 (patch)
tree617f11702e19fd0cc2f07eef3a922716476ec6b9
parent5b394b2ddf0347bef56e50c69a58773c94343ff3 (diff)
watchdog: Mark watchdog touch functions as notrace
Some architectures need to use stop_machine() to patch functions for ftrace, and the assumption is that the stopped CPUs do not make function calls to traceable functions when they are in the stopped state. Commit ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") added calls to the watchdog touch functions from the stopped CPUs and those functions lack notrace annotations. This leads to crashes when enabling/disabling ftrace on ARM kernels built with the Thumb-2 instruction set. Fix it by adding the necessary notrace annotations. Fixes: ce4f06dcbb5d ("stop_machine: Touch_nmi_watchdog() after MULTI_STOP_PREPARE") Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: oleg@redhat.com Cc: tj@kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180821152507.18313-1-vincent.whitchurch@axis.com
-rw-r--r--kernel/watchdog.c4
-rw-r--r--kernel/watchdog_hld.c2
-rw-r--r--kernel/workqueue.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 5470dce212c0..977918d5d350 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -261,7 +261,7 @@ static void __touch_watchdog(void)
261 * entering idle state. This should only be used for scheduler events. 261 * entering idle state. This should only be used for scheduler events.
262 * Use touch_softlockup_watchdog() for everything else. 262 * Use touch_softlockup_watchdog() for everything else.
263 */ 263 */
264void touch_softlockup_watchdog_sched(void) 264notrace void touch_softlockup_watchdog_sched(void)
265{ 265{
266 /* 266 /*
267 * Preemption can be enabled. It doesn't matter which CPU's timestamp 267 * Preemption can be enabled. It doesn't matter which CPU's timestamp
@@ -270,7 +270,7 @@ void touch_softlockup_watchdog_sched(void)
270 raw_cpu_write(watchdog_touch_ts, 0); 270 raw_cpu_write(watchdog_touch_ts, 0);
271} 271}
272 272
273void touch_softlockup_watchdog(void) 273notrace void touch_softlockup_watchdog(void)
274{ 274{
275 touch_softlockup_watchdog_sched(); 275 touch_softlockup_watchdog_sched();
276 wq_watchdog_touch(raw_smp_processor_id()); 276 wq_watchdog_touch(raw_smp_processor_id());
diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c
index 1f7020d65d0a..71381168dede 100644
--- a/kernel/watchdog_hld.c
+++ b/kernel/watchdog_hld.c
@@ -29,7 +29,7 @@ static struct cpumask dead_events_mask;
29static unsigned long hardlockup_allcpu_dumped; 29static unsigned long hardlockup_allcpu_dumped;
30static atomic_t watchdog_cpus = ATOMIC_INIT(0); 30static atomic_t watchdog_cpus = ATOMIC_INIT(0);
31 31
32void arch_touch_nmi_watchdog(void) 32notrace void arch_touch_nmi_watchdog(void)
33{ 33{
34 /* 34 /*
35 * Using __raw here because some code paths have 35 * Using __raw here because some code paths have
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 60e80198c3df..0280deac392e 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5574,7 +5574,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
5574 mod_timer(&wq_watchdog_timer, jiffies + thresh); 5574 mod_timer(&wq_watchdog_timer, jiffies + thresh);
5575} 5575}
5576 5576
5577void wq_watchdog_touch(int cpu) 5577notrace void wq_watchdog_touch(int cpu)
5578{ 5578{
5579 if (cpu >= 0) 5579 if (cpu >= 0)
5580 per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies; 5580 per_cpu(wq_watchdog_touched_cpu, cpu) = jiffies;