]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0345-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0345-kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch
1 From 1b96d54cc0f69e08f25fc1ae50016674911ae6c7 Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Thu, 19 May 2016 17:45:27 +0200
4 Subject: [PATCH 345/366] kernel/printk: Don't try to print from IRQ/NMI region
5
6 On -RT we try to acquire sleeping locks which might lead to warnings
7 from lockdep or a warn_on() from spin_try_lock() (which is a rtmutex on
8 RT).
9 We don't print in general from a IRQ off region so we should not try
10 this via console_unblank() / bust_spinlocks() as well.
11
12 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
13 ---
14  kernel/printk/printk.c | 10 ++++++++++
15  1 file changed, 10 insertions(+)
16
17 diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
18 index cd377c4..cbc627a 100644
19 --- a/kernel/printk/printk.c
20 +++ b/kernel/printk/printk.c
21 @@ -1526,6 +1526,11 @@ static void call_force_console_drivers(const char *force_text,
22         if (!console_drivers)
23                 return;
24  
25 +       if (IS_ENABLED(CONFIG_PREEMPT_RT_BASE)) {
26 +               if (in_irq() || in_nmi())
27 +                       return;
28 +       }
29 +
30         migrate_disable();
31         for_each_console(con) {
32                 if (exclusive_console && con != exclusive_console)
33 @@ -2514,6 +2519,11 @@ void console_unblank(void)
34  {
35         struct console *c;
36  
37 +       if (IS_ENABLED(CONFIG_PREEMPT_RT_BASE)) {
38 +               if (in_irq() || in_nmi())
39 +                       return;
40 +       }
41 +
42         /*
43          * console_unblank can no longer be called in interrupt context unless
44          * oops_in_progress is set to 1..
45 -- 
46 1.9.1
47