| From ae3bdf41a22ac2df9f1cee80f4e27141d6f70149 Mon Sep 17 00:00:00 2001 |
| From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| Date: Thu, 19 May 2016 17:12:34 +0200 |
| Subject: [PATCH] kernel/rtmutex: only warn once on a try lock from bad context |
| |
| One warning should be enough to get one motivated to fix this. It is |
| possible that this happens more than once and so starts flooding the |
| output. Later the prints will be suppressed so we only get half of it. |
| Depending on the console system used it might not be helpfull. |
| |
| Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| |
| diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c |
| index 6385fda390d1..dbbf116249e6 100644 |
| --- a/kernel/locking/rtmutex.c |
| +++ b/kernel/locking/rtmutex.c |
| @@ -1479,7 +1479,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); |
| int __sched rt_mutex_trylock(struct rt_mutex *lock) |
| { |
| #ifdef CONFIG_PREEMPT_RT_FULL |
| - if (WARN_ON(in_irq() || in_nmi())) |
| + if (WARN_ON_ONCE(in_irq() || in_nmi())) |
| #else |
| if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq())) |
| #endif |
| -- |
| 2.5.0 |
| |