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

   ## Summary
   
   
   Since the per-arch `up_testset()` was removed, `spin_lock()` is an
   LDAEX/STREX exchange. The Cortex-M33 sends an exclusive access to the RP2350
   global exclusive monitor only for Shareable memory. The default memory map
   makes the SRAM Non-shareable, so each core sees only its local monitor, and
   both can take `g_cpu_irqlock` at the same time. Both CPUs then ran the same
   task from the ready-to-run list, `g_cpu_irqlock` was left held by no CPU,
   and the system hung in the middle of `smp` or `ostest`.
   
   This PR maps the SRAM (SCRATCH_X/Y included, 0x20000000-0x20081fff) as
   Normal, Non-cacheable, Shareable memory with one MPU region, and keeps the
   default memory map for everything else (`PRIVDEFENA`). The MPU is banked per
   core, so core 0 sets it up in `__start()` and core 1 in `core1_boot()`.
   
   The MAIR layout matches `mpu_control()` in `armv8-m/arm_mpu.c` (Non-cacheable
   at index 2), so it won't clash with the generic MPU code. The SRAM-end
   comment in `rp23xx_memorymap.h` is corrected as well.
   Fixes #16133.
   
   ## Impact
   
   - RP23XX only. The region is set up only with `CONFIG_SMP`.
   - RP2350 has no core data cache, so mapping the SRAM Non-cacheable costs no
     performance. The only real change is the shareability.
   - Known limitations (documented in `rp23xx_mpu.h`):
     - A resume from suspend to RAM does not set the region up. The suspend
       support does not handle SMP yet.
     - Objects in PSRAM (`RP23XX_PSRAM_HEAP_SINGLE`) are not covered by the
       global exclusive monitor.
   - No API, Kconfig or board changes.
   
   ## Testing
   
   Host: [Arch Linux / arm-none-eabi-gcc 16.2.0]
   Board: raspberrypi-pico-2, configs `raspberrypi-pico-2:smp`
   
   ```
   nsh> uname -a
   NuttX 13.1.0 6b4d293e3f Oct 28 2026 19:46:45 arm raspberrypi-pico-2
   ```
   
   Before:
   - `smp` / `ostest` hang partway through the output
   
   After:
   - `smp`: [passes, 10 iterations]
   - `ostest`: [passes, 10 iterations]
   - `tools/checkpatch.sh` passes on the changed files.
   


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