This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 5f3d9911fa47df01553a9db10d0347ac54b2dfcd
Author: dongjiuzhu1 <[email protected]>
AuthorDate: Thu Nov 26 12:00:11 2026 +0800

    drivers/serial/uart_rpmsg: take the uart spinlock instead of a critical 
section
    
    The other serial drivers protect the receive path with the uart spinlock
    since commit 6b1092ae312 ("drivers/serial: using small lock to replease
    enter/leave_critical_section"). uart_rpmsg_ept_cb() still entered a
    critical section; take the uart spinlock as well.
    
    Signed-off-by: dongjiuzhu1 <[email protected]>
    Signed-off-by: Bowen Wang <[email protected]>
---
 drivers/serial/uart_rpmsg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/uart_rpmsg.c b/drivers/serial/uart_rpmsg.c
index 7225e9d5943..074f3adcf34 100644
--- a/drivers/serial/uart_rpmsg.c
+++ b/drivers/serial/uart_rpmsg.c
@@ -402,11 +402,11 @@ static int uart_rpmsg_ept_cb(FAR struct rpmsg_endpoint 
*ept, FAR void *data,
 
       /* Get write-cmd, there are some data, we need receive them */
 
-      flags = enter_critical_section();
+      flags = uart_spinlock(dev, true);
       priv->recv_data = data;
       uart_recvchars_dma(dev);
       priv->recv_data = NULL;
-      leave_critical_section(flags);
+      uart_spinunlock(dev, true, flags);
 
       header->response = 1;
       rpmsg_send(ept, msg, sizeof(*msg));

Reply via email to