Conversation
aabadie
left a comment
There was a problem hiding this comment.
Nice one! Thanks!
I ran the compile_and_test_for_board.py on atmega256rfr2-xpro and this PR is fixing the isr_yield_higher test. No regressions in tests were found by the script.
I agree that using an std atomic variable is nicer than the previous solution.
So I would say that once my tiny comments are addressed, this is good to go.
|
Using the C11 atomics is inherently incompatible with C++. I was aware of that, but I wasn't aware that I could use the preprocessor to only provide the I just revert the change to C11 atomics now, so that the actual bugfix can get in swiftly. |
Names with two leading underscores are reserved in any context of the c standard, and thus must not be used. This ATmega platform used it however for defining internal stuff. This commit fixes this.
At the end of an ISR, the ATmega code was doing an `thread_yield()` instead of a `thread_yield_higher()`. This resulted in tests/isr_yield_higher failing. Fixing this saves a few lines of code, some ROM, and solves the issue.
b513659 to
606d72f
Compare
|
OK. I updated to remove the C11 atomics and squash. The commits were a bit mere entangled that I expected, so I had to do some manual merging. I hope I didn't mess up anything :-D |
Replace __enter_isr() with atmega_enter_isr() and __exit_isr() with atmega_exit_isr()
|
Murdock is super helpful of detecting all the leftovers :-) The fact that atmega specific code is called in |
|
@kaspar030: The Murdock failure seems unrelated, but nasty. Like a bug that is only triggered when the stars are aligned in a specific way. Murdock doesn't provide core dumps for tests failed on native, does it? |
|
I triggered a rebuild now. The issue is documented here, in case this is needed. Because a second similar issue occurred on the same machine, I now think that too much load resulting in the timeouts in both cases is the most plausible explanation, rather than a latent bug locking up RIOT on |
aabadie
left a comment
There was a problem hiding this comment.
ACK
No regression in other tests on atmega256rfr2-xpro and isr_yield_higher is fixed. Code changes are justified and documented.
Contribution description
cpu/atmega_common:Use a C11 atomic instead ofvolatile+__asm__ volatile("" ::: "memory");for the flag used to check if the ATmega is in IRQ contextthread_yield()is executed at the end of an ISR, but correct behavior isthread_yield_higher(); This PR changes this to behave likethread_yield_higher()tests/isr_yield_higherpassesTesting procedure
tests/isr_yield_highernow really passestests/thread_cooperation/,tests/thread_basic/,tests/periph_timer,tests/sched_testing, ...)Issues/PRs references
Tick
tests/isr_yield_higherin #12651