-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/cortexm_common: flush pipeline before disabling interrupts in idle #15236
Conversation
When enabling & disabling interrupts back-to-back pending interrupts are not serviced on Cortex-M23/M33. Flush the pipeline to give interrupts a chance of executing in `sched_arch_idle()`. This fixes `no_idle_thread` on Cortex-M23.
@kfessel: This might solve the issue you recently experience on the Nucleo-F767ZI |
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.
ACK. Even if the extra pipeline flush might not be needed for every Cortex M variant, it is better to be safe than sorry here. (And the additional overhead should be not too bad.)
This is also fixing the issue I had in #15192 (M33). With this PR (and without the idle thread), it works like a charm. |
Failed tests are
|
Nice catch @benpicco! 😄 |
@maribu: sandly i still got hourly "gnrc_netif: possibly lost interrupt." after i rebased on current master with this patch merged. (but the examples stayed running (gnrc_simple and the gcoap example )) -> i will run a retest with my project code |
That is expected. If the load is too high, more messages will be generated than the message queue can store. This is due to the design choice of choosing receiver allocated messages in GNRC for communication. What this should fix is the hang you experienced one night during context switch. |
Contribution description
When enabling & disabling interrupts back-to-back pending interrupts are not serviced on Cortex-M23/M33.
Flush the pipeline to give interrupts a chance of executing in
sched_arch_idle()
.This fixes
no_idle_thread
on Cortex-M23.Testing procedure
Issues/PRs references
#14557 (comment)