aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxim Yu. Osipov <mosipov@ilbers.de>2017-08-14 10:27:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-28 14:51:22 -0400
commit81b289cc14ba349cc4707cf664aa1c72d7dff1d7 (patch)
treee47e7b10e384a998668f5b2bb166e9a18ca64910
parent3d16ddc13c5e56726d05b4eceb766b06483e3686 (diff)
tty: serial: imx: disable irq after suspend
If any key on console is pressed when board is suspended, board hangs. Driver's interrupt handler must be guaranteed not to run while resume/suspend_noirq() are being executed. See include/linux/pm.h for details. Tested on i.MX6 based board. The idea of this fix is based on commit in official i.MX kernel tree: http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git commit 81e8e7d91d81 ("tty: serial: imx: disable irq after suspend") Disable rx irq after suspend to avoid interrupt coming in early resume. Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3964ae55e44c..d879a9b86424 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2321,6 +2321,7 @@ static int imx_serial_port_suspend(struct device *dev)
2321 serial_imx_enable_wakeup(sport, true); 2321 serial_imx_enable_wakeup(sport, true);
2322 2322
2323 uart_suspend_port(&imx_reg, &sport->port); 2323 uart_suspend_port(&imx_reg, &sport->port);
2324 disable_irq(sport->port.irq);
2324 2325
2325 /* Needed to enable clock in suspend_noirq */ 2326 /* Needed to enable clock in suspend_noirq */
2326 return clk_prepare(sport->clk_ipg); 2327 return clk_prepare(sport->clk_ipg);
@@ -2335,6 +2336,7 @@ static int imx_serial_port_resume(struct device *dev)
2335 serial_imx_enable_wakeup(sport, false); 2336 serial_imx_enable_wakeup(sport, false);
2336 2337
2337 uart_resume_port(&imx_reg, &sport->port); 2338 uart_resume_port(&imx_reg, &sport->port);
2339 enable_irq(sport->port.irq);
2338 2340
2339 clk_unprepare(sport->clk_ipg); 2341 clk_unprepare(sport->clk_ipg);
2340 2342