]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00178951-1 serial/imx: dead lock dedected when handle sysrq
authorJason Liu <r64343@freescale.com>
Sun, 1 Apr 2012 08:33:25 +0000 (16:33 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:22 +0000 (08:34 +0200)
imx_rxint -> spin_lock_irqsave(&sport->port.lock, flags);

And then it will call the following functions:

uart_handle_sysrq_char -> handle_sysrq -> printk ->
__call_console_write_drivers -> imx_console_write ->

Here the imx_console_write function will call:
spin_lock_irqsave(&sport->port.lock, flags);

The A-A deadlock happens. We need spin_unlock before handle sysrq char
and spin_lock again after it.

Signed-off-by: Jason Liu <r64343@freescale.com>
drivers/tty/serial/imx.c

index 10163b61cda17815167baf21f8995cefec794688..f8cd9bd076ce87a9305537435bba53016b0d09a2 100644 (file)
@@ -553,8 +553,10 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
                                continue;
                }
 
+               spin_unlock_irqrestore(&sport->port.lock, flags);
                if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
                        continue;
+               spin_lock_irqsave(&sport->port.lock, flags);
 
                if (unlikely(rx & URXD_ERR)) {
                        if (rx & URXD_BRK)