Skip to contentSkip to conversation

tty: serial: imx: disable irq after suspend

PATCH New Maxim Yu. Osipov 2 participants 2 messages Nov 27, 2017 – Dec 8, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: imx: disable irq after suspend

commit 81b289cc14ba349cc4707cf664aa1c72d7dff1d7 upstream.

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.

---
 drivers/tty/serial/imx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/imx.c +2 -0
index 016e4be05cec..fae8c83708b1 100644
@@ -2108,6 +2108,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);
 
 	return 0;
 }
@@ -2121,6 +2122,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);
 
 	return 0;
 }
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 tty: serial: imx: disable irq after suspend

Quoted 4 lines · Maxim Yu. Osipov

commit 81b289cc14ba349cc4707cf664aa1c72d7dff1d7 upstream.

If any key on console is pressed when board is suspended, board hangs.

This looks like something that should be applied to stable branches, not just the CIP 4.4 branch.

Ben.

Quoted 42 lines

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.

---
?drivers/tty/serial/imx.c | 2 ++
?1 file changed, 2 insertions(+)

drivers/tty/serial/imx.c +0 -0
index 016e4be05cec..fae8c83708b1 100644
@@ -2108,6 +2108,7 @@ static int imx_serial_port_suspend(struct
 device *dev)
 ?	serial_imx_enable_wakeup(sport, true);

?
? uart_suspend_port(&imx_reg, &sport->port);

drivers/tty/serial/imx.c +1 -0
+	disable_irq(sport->port.irq);

?
? return 0;
?}

drivers/tty/serial/imx.c +0 -0
@@ -2121,6 +2122,7 @@ static int imx_serial_port_resume(struct device
 *dev)
 ?	serial_imx_enable_wakeup(sport, false);

?
? uart_resume_port(&imx_reg, &sport->port);

drivers/tty/serial/imx.c +1 -0
+	enable_irq(sport->port.irq);

?
? return 0;
?}

Signature · 2 lines
Ben Hutchings
Software Developer, Codethink Ltd.