raiden00pl opened a new pull request, #22381:
URL: https://github.com/apache/nuttx/pull/22381

     ## Summary
     
     `pl011_rxint()` updates IMSC with a read-modify-write that holds no lock, 
while `pl011_txint()` updates the same register under `sport->lock`. On SMP, 
`uart_readv()` re-enables RX on one CPU while the TX interrupt calls 
`pl011_txint(false)` on another, so one update can
     overwrite the other. IMSC ends up 0, the UART stops raising interrupts, 
and console input stops while output still works.
     
     `pl011_rxint()` now takes `sport->lock`.  `pl011_putc()` no longer 
busy-waits with the lock held; it writes DR only when the TX FIFO is not full, 
and drops the lock between attempts.
     
     Cherry-picked from open-vela/nuttx commit 
7a7f18cf1fa7bd58e68f413f7ae168b43a97c527.
     
     ## Impact
     
     PL011 users with CONFIG_SMP=y.  With the race hit, NSH waits forever in 
`read()` on the console.
     
     ## Testing
     
     qemu-armv8a, 4 CPUs (`-smp 4`, GICv3), NSH console on PL011: 8 QEMU 
instances in parallel, each running 600 rounds of background TCP/UDP loopback 
servers and clients from NSH.
                                          
     - master: 3 of 8 instances lost console input (IMSC read 0x00000000 from 
the debugger).                                                                  
                                                                                
                                      
     - this PR: 8 of 8 completed all rounds.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to