]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0338-tty-serial-8250-don-t-take-the-trylock-during-oops.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0338-tty-serial-8250-don-t-take-the-trylock-during-oops.patch
1 From 27f3814ce183a4235bb5fbbbf3f06b4a33ec0056 Mon Sep 17 00:00:00 2001
2 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
3 Date: Mon, 11 Apr 2016 16:55:02 +0200
4 Subject: [PATCH 338/366] tty: serial: 8250: don't take the trylock during oops
5
6 An oops with irqs off (panic() from irqsafe hrtimer like the watchdog
7 timer) will lead to a lockdep warning on each invocation and as such
8 never completes.
9 Therefore we skip the trylock in the oops case.
10
11 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
12 ---
13  drivers/tty/serial/8250/8250_port.c | 4 ++--
14  1 file changed, 2 insertions(+), 2 deletions(-)
15
16 diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
17 index 91b831a1..a0b9e85 100644
18 --- a/drivers/tty/serial/8250/8250_port.c
19 +++ b/drivers/tty/serial/8250/8250_port.c
20 @@ -2844,9 +2844,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
21  
22         serial8250_rpm_get(up);
23  
24 -       if (port->sysrq)
25 +       if (port->sysrq || oops_in_progress)
26                 locked = 0;
27 -       else if (oops_in_progress || in_kdb_printk())
28 +       else if (in_kdb_printk())
29                 locked = spin_trylock_irqsave(&port->lock, flags);
30         else
31                 spin_lock_irqsave(&port->lock, flags);
32 -- 
33 1.9.1
34