aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/mpc52xx_uart.c
diff options
context:
space:
mode:
authorAndrew Liu <shengping.liu@windriver.com>2008-04-29 03:36:25 -0400
committerGrant Likely <grant.likely@secretlab.ca>2008-05-01 13:59:12 -0400
commitfbe543b412cef02350fab35526a6d4dc3d20d182 (patch)
treea47e56379bc0611e1d15e6318c58d9a3bcd23478 /drivers/serial/mpc52xx_uart.c
parent80791be11145f7dd7f68c84741fc66e5164b7353 (diff)
Fix a potential issue in mpc52xx uart driver
mpc52xx_uart_int and __uart_put_char both try to acquire the port->lock. Therefore the function sequence of: mpc52xx_uart_int--> ...-->flush_to_ldisc-->...-->__uart_put_char can potentially trigger a deadlock. To avoid this deadlock a fix similar to that found in the 8250.c serial driver is applied. The deadlock is avoided by releasing the lock before pushing a buffer and reacquiring it when completed. Signed-off-by: Andrew Liu <shengping.liu@windriver.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/serial/mpc52xx_uart.c')
-rw-r--r--drivers/serial/mpc52xx_uart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 7a3625f52a03..efc971d9647b 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -783,7 +783,9 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
783 } 783 }
784 } 784 }
785 785
786 spin_unlock(&port->lock);
786 tty_flip_buffer_push(tty); 787 tty_flip_buffer_push(tty);
788 spin_lock(&port->lock);
787 789
788 return psc_ops->raw_rx_rdy(port); 790 return psc_ops->raw_rx_rdy(port);
789} 791}