yangsong8-a1 opened a new pull request, #22218:
URL: https://github.com/apache/nuttx/pull/22218
## Summary
Remove the redundant enter_critical_section()/leave_critical_section()
calls in the SMPS upper-half driver's open and close paths.
Both smps_open() and smps_close() already hold the closelock mutex
while calling ops->setup() and ops->shutdown(). The critical section
inside the mutex-protected region is unnecessary: the mutex serializes
concurrent open/close calls, and the lower-half callbacks are not
called from interrupt context.
The same cleanup was done for `powerled.c` in PR #22190.
## Impact
No functional change. The setup() and shutdown() callbacks are still
serialized by the closelock mutex.
In-tree lower-half implementations:
boards/arm/stm32f3/stm32f334-disco/src/stm32_smps.c
boards/arm/stm32g4/b-g474e-dpow1/src/stm32_smps.c
## Testing
Ubuntu 22.04, host gcc, CMake + Ninja.
Build configs:
- `sim:nsh` + `CONFIG_DRIVERS_SMPS=y` — no new warnings.
- `stm32f334-disco:buckboost` (ARM cross-compile) — no new warnings.
A temporary test program registers a dummy lower half and opens/closes
`/dev/smps0` 200 times from each of two threads. The output is the same
on master and with this change:
nsh> hello
smps_register: 0
setup 400 shutdown 400
--
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]