Skip to content
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

riscv_common: make thread_yield_higher IRQ compatible #15942

Merged

Conversation

bergzand
Copy link
Member

@bergzand bergzand commented Feb 8, 2021

Contribution description

This should resolve the issues mentioned here. The thread_yield_higher function now checks if it is executed from interrupt context and just set the sched_context_switch_request flag if it is in interrupt context.

Testing procedure

These tests should work again:

  • tests/event_wait_timeout
  • tests/thread_flags
  • tests/thread_flags_xtimer.

Issues/PRs references

Fixes regressions mentioned here

@bergzand bergzand added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: RISC-V Platform: This PR/issue effects RISC-V-based platforms labels Feb 8, 2021
@bergzand bergzand requested a review from aabadie February 8, 2021 10:11
@bergzand bergzand added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 8, 2021
@jia200x
Copy link
Member

jia200x commented Feb 8, 2021

I guess this should be backported

@jia200x jia200x added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Feb 8, 2021
@aabadie
Copy link
Contributor

aabadie commented Feb 8, 2021

This PR fixes the failing tests:

./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . hifive1b --jobs=6 --applications="tests/event_wait_timeout tests/thread_flags tests/thread_flags_xtimer"
INFO:hifive1b:Saving toolchain
INFO:hifive1b.tests/event_wait_timeout:Board supported: True
INFO:hifive1b.tests/event_wait_timeout:Board has enough memory: True
INFO:hifive1b.tests/event_wait_timeout:Application has test: True
INFO:hifive1b.tests/event_wait_timeout:Run compilation
INFO:hifive1b.tests/event_wait_timeout:Run test
INFO:hifive1b.tests/event_wait_timeout:Run test.flash
INFO:hifive1b.tests/event_wait_timeout:Success
INFO:hifive1b.tests/thread_flags:Board supported: True
INFO:hifive1b.tests/thread_flags:Board has enough memory: True
INFO:hifive1b.tests/thread_flags:Application has test: True
INFO:hifive1b.tests/thread_flags:Run compilation
INFO:hifive1b.tests/thread_flags:Run test
INFO:hifive1b.tests/thread_flags:Run test.flash
INFO:hifive1b.tests/thread_flags:Success
INFO:hifive1b.tests/thread_flags_xtimer:Board supported: True
INFO:hifive1b.tests/thread_flags_xtimer:Board has enough memory: True
INFO:hifive1b.tests/thread_flags_xtimer:Application has test: True
INFO:hifive1b.tests/thread_flags_xtimer:Run compilation
INFO:hifive1b.tests/thread_flags_xtimer:Run test
INFO:hifive1b.tests/thread_flags_xtimer:Run test.flash
INFO:hifive1b.tests/thread_flags_xtimer:Success
INFO:hifive1b:Tests successful

I'm running the full test suite, just to be sure nothing else is broken.

@bergzand
Copy link
Member Author

bergzand commented Feb 8, 2021

I'm running the full test suite, just to be sure nothing else is broken.

Thanks, appreciated!

@aabadie
Copy link
Contributor

aabadie commented Feb 8, 2021

Now I have this:

Failures during test:
- [tests/gnrc_ipv6_fwd_w_sub](tests/gnrc_ipv6_fwd_w_sub/test.failed)
- [tests/periph_timer_short_relative_set](tests/periph_timer_short_relative_set/test.failed)
- [tests/periph_wdt](tests/periph_wdt/test.failed)
- [tests/pkg_utensor](tests/pkg_utensor/test.failed)
- [tests/ps_schedstatistics](tests/ps_schedstatistics/test.failed)
- [tests/sys_architecture](tests/sys_architecture/test.failed)
- [tests/xtimer_periodic_wakeup](tests/xtimer_periodic_wakeup/test.failed)
- [tests/xtimer_usleep](tests/xtimer_usleep/test.failed)

So no new failures!

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Code changes are good and are fixing the failing tests. I didn't find any regression.

ACK

@aabadie aabadie merged commit 317534f into RIOT-OS:master Feb 8, 2021
@bergzand bergzand deleted the pr/riscv_common/thread_yield_in_irq branch February 8, 2021 14:43
@jia200x
Copy link
Member

jia200x commented Feb 9, 2021

could you please provide a backport against 2021.01-branch?

@aabadie
Copy link
Contributor

aabadie commented Feb 9, 2021

could you please provide a backport against 2021.01-branch?

it might be difficult because this PR was opened after #15718 was merged.

@jia200x
Copy link
Member

jia200x commented Feb 9, 2021

it might be difficult because this PR was opened after #15718 was merged.

Sorry, I thought this was related to #15736. Since nobody replied #15942 (comment), I assumed it was in ;)

@jia200x jia200x removed the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Feb 9, 2021
@bergzand
Copy link
Member Author

bergzand commented Feb 9, 2021

could you please provide a backport against 2021.01-branch?

Done, see #15961.

it might be difficult because this PR was opened after #15718 was merged.

It's an artisanal handcrafted backport :)

@kaspar030 kaspar030 added this to the Release 2021.04 milestone Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants