aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-12-22 16:39:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-04 19:30:36 -0500
commit995234da19b927f42722d796e8270384f33be11c (patch)
tree022d3696bb38afa1486b2962ba3f51458b35b21b
parent01f56abd089dd216e537817b61497c58bb66aab3 (diff)
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 <fabio.estevam@freescale.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Eric Miao <eric.miao@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/tty/serial/imx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 6b98a524eca2..0b7fed746b27 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -932,6 +932,8 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
932 ucr2 |= UCR2_PROE; 932 ucr2 |= UCR2_PROE;
933 } 933 }
934 934
935 del_timer_sync(&sport->timer);
936
935 /* 937 /*
936 * Ask the core to calculate the divisor for us. 938 * Ask the core to calculate the divisor for us.
937 */ 939 */
@@ -962,8 +964,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
962 sport->port.ignore_status_mask |= URXD_OVRRUN; 964 sport->port.ignore_status_mask |= URXD_OVRRUN;
963 } 965 }
964 966
965 del_timer_sync(&sport->timer);
966
967 /* 967 /*
968 * Update the per-port timeout. 968 * Update the per-port timeout.
969 */ 969 */