Swatantra-66 opened a new pull request, #20677:
URL: https://github.com/apache/nuttx/pull/20677

   Submitted on behalf of Kerogit <[email protected]> per the patch series and 
discussion on [email protected].
   
   ## Summary
   This patch series fixes build failure for AVR DA/DB family and adds some 
other smaller fixes.
   
   The build failure was caused by patch series that added LIBC_ATOMIC_IRQ 
Kconfig option during 13.1 development. Commit 4ca2256a9bee selects this option 
by default for AVR chips but not for the DA/DB family, causing a build failure 
(atomic functions are missing.) The first patch of this series simply adds 
missing "select LIBC_ATOMIC_IRQ" for this family as well.
   
   Other than that, version 13.1 added a performance regression which 
manifested as dropped bytes in USART peripheral during receive (with heavy 
round-robin preemptive scheduling load.) The regression was bisected to commit 
b32712d0a2 that fixes some bugs (which were affecting AVR DA/DB default build 
as well) but apparently adds more time-consuming work to context switch with 
interrupts disabled. The patch for this simply documents this possibility in 
the USART driver description.
   
   The remaining patches fix unused variable warning, make (very unlikely) 
board initialization error more visible and reorder manipulation with stack 
pointer during context restore to do it in the way (presumably) intended by the 
chip manufacturer.
   
   ## Impact
   After the patch is applied, it is again possible to build the code.
   Other than that, there is no impact on existing code/users.
   The stack pointer reordering change is done in file shared with other AVR 
families - #ifdef blocks are used to cause no change for them.
   
   ## Testing
   I confirm that changes are verified on local setup and work as intended:
   * Build Host: Linux, AMD, GCC-AVR 14.2
   * Target: AVR (AVR128DA28), breadxavr:nsh
   
   Testing logs before change:
   ```
   $ tools/configure.sh -l breadxavr:nsh
   $ make -j16
   ...
   avr-ld: .../nuttx.git/staging/libsched.a(sem_destroy.o): in function `.L3':
   sem_destroy.c:(.text.nxsem_destroy+0x46): undefined reference to 
`__atomic_load_4'
   ...
   ```
   
   Testing logs after change:
   ```
   $ tools/configure.sh -l breadxavr:nsh
   $ make -j16
   Register: nsh
   Register: sh
   LD: nuttx
   Memory region Used Size Region Size %age Used
   flash: 56377 B 128 KB 43.01%
   sram: 780 B 16 KB 4.76%
   eeprom: 0 B 512 B 0.00%
   rodata: 606 B 4 KB 14.79%
   CP: nuttx.hex
   CP: nuttx.asm
   ```
   
   To verify that the stack pointer change did not affect other AVR families, 
mega1284p-xplained:nsh was built before and after the change. The resulting 
binary was identical (with the exception of version string.)
   Header and source files were checked by checkpatch with no issues found, 
spelling checked with aspell.
   
   ## PR verification Self-Check
   * [x] This PR introduces only one functional change.
   * [x] I have updated all required description fields above.
   * [x] My PR adheres to Contributing Guidelines and Documentation (git commit 
title and message, coding standard, etc).
   * [ ] My PR is still work in progress (not ready for review).
   * [x] My PR is ready for review and can be safely merged into a codebase.
   


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