You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/09/01 09:55:23 UTC

[incubator-nuttx] branch master updated: arch: cxd56xx: Use spinlock API in cxd56_uart.c

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7e94997  arch: cxd56xx: Use spinlock API in cxd56_uart.c
7e94997 is described below

commit 7e94997eeb4d5ccd6b59f8e766a5a45dd7a1be31
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Tue Sep 1 17:48:30 2020 +0900

    arch: cxd56xx: Use spinlock API in cxd56_uart.c
    
    Summary:
    - This commit improves cxd56_uart performance in SMP mode.
    
    Impact:
    - This commit affects SMP mode only.
    
    Testing:
    - Tested with spresense:smp
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 arch/arm/src/cxd56xx/cxd56_uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/cxd56xx/cxd56_uart.c b/arch/arm/src/cxd56xx/cxd56_uart.c
index 13f507f..5704739 100644
--- a/arch/arm/src/cxd56xx/cxd56_uart.c
+++ b/arch/arm/src/cxd56xx/cxd56_uart.c
@@ -471,7 +471,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
   uint32_t div;
   uint32_t lcr_h;
 
-  irqstate_t flags = enter_critical_section();
+  irqstate_t flags = spin_lock_irqsave();
 
   if (uartbase == CXD56_UART2_BASE)
     {
@@ -483,7 +483,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
     }
   else
     {
-      leave_critical_section(flags);
+      spin_unlock_irqrestore(flags);
       return;
     }
 
@@ -510,7 +510,7 @@ void cxd56_setbaud(uintptr_t uartbase, uint32_t basefreq, uint32_t baud)
   putreg32(lcr_h, uartbase + CXD56_UART_LCR_H);
 
 finish:
-  leave_critical_section(flags);
+  spin_unlock_irqrestore(flags);
 }
 
 /****************************************************************************