diff options
author | Jason Liu <r64343@freescale.com> | 2012-04-01 16:33:25 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-04-05 18:42:21 +0800 |
commit | 9ce3d6116bccad95a7ba4d0d3a78cf807b21a010 (patch) | |
tree | 19525fcdf04ce0b7fcfda85969fc9af65164a045 | |
parent | 399c395d3ed0af998a5855628d064044bafb82bb (diff) |
ENGR00178951-1 serial/imx: dead lock dedected when handle sysrq
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>
-rw-r--r-- | drivers/tty/serial/imx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 10163b61cda1..f8cd9bd076ce 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -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) |