Skip to contentSkip to conversation

tty: serial: imx: clear the RTSD status before enable the RTSD irq

PATCH Superseded Sherry Sun 2 participants 2 messages Nov 23, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Sherry Sun

author
#0 lore raw

PATCH v2 1/1 tty: serial: imx: clear the RTSD status before enable the RTSD irq

From: Fugang Duan <[email protected]>

Clear RTSD status before enabling the irq event for RTSD in imx_uart_enable_wakeup function.
Since RTSD can be set as the wakeup source, this can avoid any risk of false triggering of a wake-up interrupts.

---
changes in V2:
- change the subject and the commit message as suggested by Uwe.

---
 drivers/tty/serial/imx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/tty/serial/imx.c +4 -2
index 90f82e6c54e4..fb75e3e0d828 100644
@@ -2482,10 +2482,12 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)
 
 	if (sport->have_rtscts) {
 		u32 ucr1 = imx_uart_readl(sport, UCR1);
-		if (on)
+		if (on) {
+			imx_uart_writel(sport, USR1_RTSD, USR1);
 			ucr1 |= UCR1_RTSDEN;
-		else
+		} else {
 			ucr1 &= ~UCR1_RTSDEN;
+		}
 		imx_uart_writel(sport, ucr1, UCR1);
 	}
 }
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#1 lore raw

Hello,

Quoted 9 lines · Sherry Sun

From: Fugang Duan <[email protected]>

Clear RTSD status before enabling the irq event for RTSD in imx_uart_enable_wakeup function.
Since RTSD can be set as the wakeup source, this can avoid any risk of false triggering of a wake-up interrupts.

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |