From: Maxim Yu. Osipov Date: Mon, 14 Aug 2017 14:27:49 +0000 (+0200) Subject: tty: serial: imx: disable irq after suspend X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=81b289cc14ba349cc4707cf664aa1c72d7dff1d7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Maxim Yu. Osipov Signed-off-by: Greg Kroah-Hartman --- 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) serial_imx_enable_wakeup(sport, true); uart_suspend_port(&imx_reg, &sport->port); + disable_irq(sport->port.irq); /* Needed to enable clock in suspend_noirq */ return clk_prepare(sport->clk_ipg); @@ -2335,6 +2336,7 @@ static int imx_serial_port_resume(struct device *dev) serial_imx_enable_wakeup(sport, false); uart_resume_port(&imx_reg, &sport->port); + enable_irq(sport->port.irq); clk_unprepare(sport->clk_ipg);