Skip to content

cpu/fe310: fixes for SW interrupt latency issues#12196

Merged
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
kenrabold:pr_thread_yield_higher
Sep 17, 2019
Merged

cpu/fe310: fixes for SW interrupt latency issues#12196
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
kenrabold:pr_thread_yield_higher

Conversation

@kenrabold
Copy link
Contributor

Fix for latency in invoking SW interrupt for context switching

Contribution description

FE310 uses a software interrupt to perform a context switch. This interrupt has a latency of 4-7 cycles, which can cause instructions to be executed after thread_yield_higher leading to unpredictable results. The bug is similar to that found in #8897.

Also added core panic support and fixed cpu_switch_context_exit logic.

Testing procedure

Tested with all tests\thread_* apps

Issues/PRs references

Fixes: #12109
Fixes: #12110

@benpicco benpicco added Area: cpu Area: CPU/MCU ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Sep 10, 2019
@kaspar030
Copy link
Contributor

This looks like nice catch! 👍

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms labels Sep 12, 2019
@nmeum
Copy link
Member

nmeum commented Sep 16, 2019

Just FYI: #12109 has been merged, you need to rebase your PR against master :)

@kenrabold kenrabold force-pushed the pr_thread_yield_higher branch from 636220d to a5ff44d Compare September 16, 2019 15:56
@benpicco
Copy link
Contributor

benpicco commented Sep 16, 2019

I'd say you can also squash.
Now we just need to find someone with a hifive1 to give this a try.
As you are the original author of this port, I think it's enough to rely on your testing.

@kenrabold kenrabold force-pushed the pr_thread_yield_higher branch from a5ff44d to 547ebd1 Compare September 16, 2019 16:33
@kenrabold
Copy link
Contributor Author

I tested the changes on both HiFive1 and HiFive1B. Both work fine.
Also squashed the commits.

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug that was present in the initial port to the new platform.
The fix looks good and was tested by the original author of the port.

@kaspar030 kaspar030 merged commit 9b4755c into RIOT-OS:master Sep 17, 2019
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fe310: handle_trap only handles interrupts

5 participants