From 31624db363767ec1afe54a1ab0bc9ac701195aeb Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Fri, 23 Dec 2011 05:30:21 +0800 Subject: tty: serial: imx: move del_timer_sync() to avoid potential deadlock del_timer_sync() acquires its own lock and doesn't have to be nested within the spinlock of sport->port.lock in imx_set_termios(), which will cause potential deadlock. Fix this by moving it outside. Cc: Fabio Estevam Cc: Shawn Guo Cc: Sascha Hauer Cc: Greg Kroah-Hartman Signed-off-by: Eric Miao --- drivers/tty/serial/imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 163fc9021f5..e018aef88df 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -901,6 +901,8 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, ucr2 |= UCR2_PROE; } + del_timer_sync(&sport->timer); + /* * Ask the core to calculate the divisor for us. */ @@ -931,8 +933,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, sport->port.ignore_status_mask |= URXD_OVRRUN; } - del_timer_sync(&sport->timer); - /* * Update the per-port timeout. */ -- cgit v1.2.3