You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/06 02:24:00 UTC

[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #3860: drivers: serial: Remove an unnecessary critical section (cs) for SMP

masayuki2009 opened a new pull request #3860:
URL: https://github.com/apache/incubator-nuttx/pull/3860


   ## Summary
   
   - I thought this cs is needed to avoid data corruption
   - For example, while executing uart_xmitchar() in the interrupt
     handler on CPU0, an application running on CPU1 can call
     uart_putxmitchar() via write()->uart_write().
   - In this case, taking xmit.sem in uart_write() will wait for CPU0
     to finish uart_xmitchar() because CPU0 has already taken a cs
     in uart_xmitchar() then nxsem_wait() on CPU0 takes a new cs
     inside (and release the cs when returning but it's OK)
   - Then uart_write() on CPU1 disables UART TX, so uart_xmitchar()
     on CPU0 will not be called while executing uart_write() on CPU1.
   - So this critical section in uart_putxmitchar() can be removed.
   
   ## Impact
   
   - None
   
   ## Testing
   
   - Tested with spresense:wifi_smp, esp32-devkitc:smp
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3860: drivers: serial: Remove an unnecessary critical section (cs) for SMP

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3860:
URL: https://github.com/apache/incubator-nuttx/pull/3860#issuecomment-855326373


   @xiaoxiang781216 
   I rewrote the summary and commit messages.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #3860: drivers: serial: Remove an unnecessary critical section (cs) for SMP

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #3860:
URL: https://github.com/apache/incubator-nuttx/pull/3860


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org