[riot-notifications] [RIOT-OS/RIOT] cpu/fe310: don't call thread_yield when sched_active_thread is invalid (#12109)

kenrabold notifications at github.com
Tue Sep 10 00:07:21 CEST 2019

I dug into this issue deeper and found that the reason for the `thread_race` and `thread_msg_block_race` failures was that when `thread_yield_higher` invokes a SW interrupt, the FE310 can take up to 4-7 cycles to respond. As a result, assembly instructions after the call to `thread_yield_higher `in the current active thread will be executed resulting in possible old data within registers. The 2 test programs I referenced produce that effect and is similar to #8897

Your simulator would not have had this issue as I'm sure you are not introducing a latency in the simulation of interrupts.

To fix this, I added 8 nops after invoking the SW interrupt. I also addressed the thread_yield call and the issue referenced in #12110

My changes are here: [https://github.com/kenrabold/RIOT/blob/pr_thread_yield_higher/cpu/fe310/cpu.c](url)

You can update your PR with these changes, or I can request the PR to pull in these fixes.

Thanks for finding this and calling it out. Good bug

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190909/57a35ada/attachment-0001.htm>

More information about the notifications mailing list