From ee02d0c7695ccb9bacf162ec43516e375eca48e7 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Thu, 13 Feb 2025 15:59:28 +0800 Subject: [PATCH] drivers/rpmsg_port_uart: switch the uart IO to GPIO when peer poweroff Use the TIOCVHANGUP to notify the driver to switch the uart io to gpio mode to avoid the current leak caused by the uart io because peer core may already poweroff so the io can be in high voltage state. Signed-off-by: Bowen Wang --- drivers/rpmsg/rpmsg_port_uart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rpmsg/rpmsg_port_uart.c b/drivers/rpmsg/rpmsg_port_uart.c index f85bba90be0..34f60060f7a 100644 --- a/drivers/rpmsg/rpmsg_port_uart.c +++ b/drivers/rpmsg/rpmsg_port_uart.c @@ -400,6 +400,7 @@ static int rpmsg_port_uart_rx_thread(int argc, FAR char *argv[]) rpmsgdbg("Received poweroff command\n"); rpmsg_port_drop_packets(&rpuart->port, RPMSG_PORT_DROP_TXQ); rpmsg_port_unregister(&rpuart->port); + DEBUGVERIFY(file_ioctl(&rpuart->file, TIOCVHANGUP, 0) >= 0); rpuart->connected = false; continue; }