-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC #14681
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
arch_atomic : Introduce CONFIG_LIBC_ARCH_ATOMIC #14681
Conversation
|
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. Here's why and how to fix it: Missing Information/Improvements Needed:
Example of Improved Impact Section:
By addressing these points, your PR will be much stronger and easier for reviewers to evaluate. Remember, clarity and thoroughness are key to a successful contribution! |
please refer following comment. |
|
Sorry I have to cancel the CI Check, there's a problem with CI Test: |
e52d399 to
60e61b9
Compare
|
About CI test : sim/cxxtest was not successful. I checked it with master and the result was same. I think this problem is not come from this PR, |
|
SSL certificate expired 😂 https://github.com/apache/nuttx/actions/runs/11735845781/job/32694187326?pr=14681#step:7:121 |
|
Hi @TakuyaMiyasita I cloned your branch to my repo and enabled all builds. Let's wait for the results here thanks! https://github.com/nuttxpr2/nuttx/actions/runs/11740819831 |
lupyuen
left a comment
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.
Looks great to me, everything builds OK except for the 2 SSL Cert Errors. Thanks! :-)
https://github.com/nuttxpr2/nuttx/actions/runs/11740819831
60e61b9 to
66c8e3f
Compare
903d1df to
f1b2ab6
Compare
f1b2ab6 to
0a2ae9d
Compare
|
@xiaoxiang781216 |
you are welcome, thank sending patch to fix the issue, which make the atomic support more generalize than before. |
cbc21c6 to
662cf5d
Compare
|
@TakuyaMiyasita but the new patch doesn't resolve my and @masayuki2009 's comment. |
662cf5d to
06de36d
Compare
Some armv7-m-based SoCs do not work with atomic instructions, even though armv7-m supports them. To avoid using atomic instructions generated by gcc, CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which arch_atomic.c is linked explicitly. However, the function names need to be changed to avoid build errors, since the functions described in stdatomic.h are gcc built-in and inlined when the code is compiled. Signed-off-by: Takuya Miyasita <Takuya.Miyashita@sony.com>
06de36d to
14514dc
Compare
|
@xiaoxiang781216 @masayuki2009 |
|
LGTM. |
|
Sorry @TakuyaMiyasita: I think https://github.com/NuttX/nuttx/actions/runs/11791606414/job/32843958478#step:7:19347 Update: There are 3 more failures at nuttx-dashboard.org: |
There are more we caught on our internal CI. I've just triggered the CI in the/before the commit specifically to double-check. As soon as it finishes, I'll report here. |
|
General reports:
That being said, we have the following build errors related to this PR:
About HW testing, we found the following bugs so far:
|
|
Let me revert this PR until esp32s3-related issues have been resolved. |
|
@tmedicci CONFIG_DEBUG_ASSERTIONS and any other debug shouldn't be included in the board config (in the past Greg rejected all defconfigs with it, now we know there are some because we don't have same quality control). In the production firmware debug assertion and/or debug symbols shouldn't be enabled. So, I think the issue needs to be fixed without this option. |
|
FYI If we need to Enable All Builds in our repo, please patch |
@tmedicci could you enable this option in some of the mainline defconfig? |
I didn't say it's enabled on defconfig, I said our internal CI enables it to test for situations where it could assert. In fact, there are some defconfigs on NuttX (upstream) that contain this config (it may have been submitted accidently): among other board's defconfigs there are a lot of them that enables it too. We need to fix that! About the debug assertions, it doesn't matter. Ideally, the issue should be fixed for both situations, right? Nothing is expected to assert. If asserted, something may not be in the right place.
Hi @xiaoxiang781216 , I didn't get your question. Do you mean about those configs I've sent? Our internal CI always "adds" them to the |
This is a bad approach. Upsteram configurations aren't production firmware but rather examples of use. Without DEBUGASSERTs enabled it's much harder to catch bugs. What's more, a developer implementing a new feature may never enable DEBUGASSERT and thus contribute a non-working driver to the upstream (which crashes when DEBUG_ASSERTIONS=y in some of the internal OS functions). Another thing, having DEBUG_SYMBOLS disabled is very irritating when you are testing configurations. |
I think there are some cases where having the DEBUG enabled by default helped us to spot some issues early. I don't remember why it wasn't accepted. |
I don't believe that the mainline defconfig is in the production quality, since many defconfig just demo how a single functionality work. Why not enable CONFIG_DEBUG_ASSERTIONS in some toy defconfig? |
since github ci doesn't catch the compiler error you report, I would expect that we change some mainline defconfig to trigger this warning, so github ci can catch it in the future. |
Oh, I see. Build errors are not related to any config (I really don't know why CI didn't get the issue. Those The other error (on HW testing) was caught by enabling CONFIG_DEBUG_ASSERTIONS. I don't see any trouble letting them enabled for all defconfigs (we can spot errors easily). Anyway, we always enabled them (using kconfig-merge) on our internal CI for all defconfigs. |
|
@lupyuen could you look at why ci can't catch the compiler error before merging? |
|
@xiaoxiang781216 That's because the CI Check for this Complex PR doesn't include xtensa-02, which contains That's why we need our NuttX Build Farm and nuttx-dashboard.org to catch these errors after merging (without incurring extra cost to NuttX Project). For Complex PRs that might break the build: I highly recommend running a Full Build in the contributor's repo: If we really need to run xtensa-01 and xtensa-02 (and arm-01) for every PR: We could set up a VM with Self-Hosted GitHub Runners, as recommended by ASF. But this will be expensive, because we need professional IT security to maintain our VM, to ensure that we don't run unauthorised code pushed down from GitHub. Yeah so we're kinda stuck :-( Update: We could also swap some targets between xtensa-01 and xtensa-02. Move the riskier, failure-prone targets from xtensa-02 into xtensa-01. And move the less risky targets from xtensa-01 out to xtensa-02. |
|
thanks for explanation, it's clear now. |
Summary
Some armv7-m-based SoCs do not work with atomic instructions, even though armv7-m supports them.
To avoid using atomic instructions generated by gcc, CONFIG_LIBC_ARCH_ATOMIC is newly introduced with which arch_atomic.c is linked explicitly.
However, the function names need to be changed to avoid build errors, since the functions described in stdatomic.h are gcc built-in and inlined when the code is compiled.
Impact
CONFIG_ARCH_CHIP_CXD32XX.
Testing
About ARCH_CHIP_CXD32XX, the build is passed and ostest is passed, but the board is out-of-tree.
About raspberrypi-pico:nsh, the build is passed. (not executed)
About spresense:smp, the build is passed. (not executed)
tool-chain version:
and