-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Revert "libs/libc/semaphore: Fix DEBUGASSERTS" #16216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "libs/libc/semaphore: Fix DEBUGASSERTS" #16216
Conversation
@jlaitine , can you take a look please? |
I kind of understand your explanation; but why on earth someone tries to take a semaphore in interrupt? Is the situation such that you know that the semaphore can't block at that point in the irq, and you want to cause some task to block on it later? But reverting that is fine by me ! |
This comes from the bt adapter, which is inspired on ESP-IDF's. Take a look at
Yes, exactly. It's used internally as signalling only (that's why we use the non-blocking version).
Thanks! |
@jlaitine please review (GH doesn't allow me add you as review) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmedicci please include the Summary info to the git commit log
This reverts commit 3009922 to fix a problem with `esp32-devkitc:blewifi`, which fails to boot up if `CONFIG_DEBUG_ASSERTIONS=y`. Introduced by apache#16176 with the following description: > The DEBUGASSERTS in nxsem_wait and nxsem_trywait are non-functional, they don't check anything. These were broken in previous commits. The above statements are not valid. Originally, there was no problem calling `nxsem_trywait` from the interrupt and the `DEBUGASSERT` simply checked a corner case: if ran from the interrupt context, the current (interrupted) task may be the idle task. This case is allowed only if called from an interrupt and that's what the original commit checks with: ``` DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask() || up_interrupt_context()); ```
a1696a6
to
48c2167
Compare
Done. |
Summary
This reverts commit 3009922 to fix a problem with
esp32-devkitc:blewifi
, which fails to boot up ifCONFIG_DEBUG_ASSERTIONS=y
.Introduced by #16176 with the following description:
The above statements are not valid. Originally, there was no problem calling
nxsem_trywait
from the interrupt and theDEBUGASSERT
simply checked a corner case: if ran from the interrupt context, the current (interrupted) task may be the idle task. This case is allowed only if called from an interrupt and that's what the original commit checks with:Impact
Impact on user: YES, it fixes the
esp32-devkitc:blewifi
defconfig, which can now be used as before.Impact on build: NO.
Impact on hardware: YES. Restore the old behavior for
esp32-devkitc:blewifi
defconfig.Impact on documentation: NO.
Impact on security: NO.
Impact on compatibility: NO.
Testing
Build the
esp32-devkitc:blewifi
and compare the results before and after applying this patch. Before applying it, the defconfig fails to boot.Building
Running
Results
Before
Before applying this patch, the device fails to boot:
After
By reverting the commit, the device boots successfully, restoring the previous behavior: