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

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


The following commit(s) were added to refs/heads/master by this push:
     new bc4a52f910 arch/arm/rp23xx: update serial code smp fixes from cxd56
bc4a52f910 is described below

commit bc4a52f9100b3c9db496fec1cbe0538eb77b059c
Author: Serg Podtynnyi <s...@podtynnyi.com>
AuthorDate: Sat May 3 23:54:19 2025 +0700

    arch/arm/rp23xx: update serial code smp fixes from cxd56
    
    Most of the code is the same, update to recent fixes
    
    Signed-off-by: Serg Podtynnyi <s...@podtynnyi.com>
---
 arch/arm/src/rp23xx/rp23xx_serial.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/src/rp23xx/rp23xx_serial.c 
b/arch/arm/src/rp23xx/rp23xx_serial.c
index eedcfcb210..b4d826ef52 100644
--- a/arch/arm/src/rp23xx/rp23xx_serial.c
+++ b/arch/arm/src/rp23xx/rp23xx_serial.c
@@ -772,11 +772,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned 
long arg)
 #endif
           priv->baud = cfgetispeed(termiosp);
 
+          spin_unlock_irqrestore(&priv->lock, flags);
+
           /* Configure the UART line format and speed. */
 
           up_set_format(dev);
-
-          spin_unlock_irqrestore(&priv->lock, flags);
         }
         break;
 #endif
@@ -903,7 +903,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
   struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
   irqstate_t flags;
 
-  flags = enter_critical_section();
+  flags = spin_lock_irqsave(&priv->lock);
   if (enable)
     {
 #ifndef CONFIG_SUPPRESS_SERIAL_INTS
@@ -914,7 +914,13 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
        * interrupts disabled (note this may recurse).
        */
 
+#  ifdef CONFIG_SMP
+      spin_unlock_irqrestore(&priv->lock, flags);
+#  endif
       uart_xmitchars(dev);
+#  ifdef CONFIG_SMP
+      flags = spin_lock_irqsave(&priv->lock);
+#  endif
 #endif
     }
   else
@@ -922,8 +928,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
       priv->ier &= ~RP23XX_UART_UARTICR_TXIC;
       up_serialout(priv, RP23XX_UART_UARTIMSC_OFFSET, priv->ier);
     }
-
-  leave_critical_section(flags);
+  spin_unlock_irqrestore(&priv->lock, flags);
 }
 
 /****************************************************************************
@@ -967,7 +972,7 @@ static bool up_txempty(struct uart_dev_s *dev)
  *
  * Description:
  *   Performs the low level UART initialization early in debug so that the
- *   serial console will be available during bootup.  This must be called
+ *   serial console will be available during boot up.  This must be called
  *   before arm_serialinit.
  *
  *   NOTE: Configuration of the CONSOLE UART was performed by up_lowsetup()

Reply via email to