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

cpu/stm32/periph_timer: fix spurious IRQs and race conditions #18969

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 24, 2022

Contribution description

This fixes in the periph_timer implementation of STM32:

  • race conditions when two threads share the same timer peripheral, but distinct sets of timer channel
  • spurious IRQs

Testing procedure

The test in #18963 should now pass

Issues/PRs references

#18963

Marian Buschsieweke added 2 commits November 24, 2022 22:34
Allow two threads to share the same timer - provided they use distinct
sets of timer channels - without occasionally corrupting registers or
state flags.
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Nov 24, 2022
@github-actions github-actions bot added Area: cpu Area: CPU/MCU ports Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Nov 24, 2022
@benpicco benpicco requested a review from fabian18 November 24, 2022 23:57
@riot-ci
Copy link

riot-ci commented Nov 25, 2022

Murdock results

✔️ PASSED

20fc71d cpu/stm32/periph_timer: fix spurious IRQs

Success Failures Total Runtime
117858 0 117858 01h:56m:36s

Artifacts

@maribu maribu merged commit cf93e9e into RIOT-OS:master Nov 25, 2022
@maribu maribu deleted the cpu/stm32/periph_timer/fix_spurious_irqs branch November 25, 2022 07:11
@maribu
Copy link
Member Author

maribu commented Nov 25, 2022

Thx!

@fabian18 the reason @benpicco pingged you is likely due to the issue you found with some network timeout triggering right aeay resulting in two transmissions where only one was expected. I cannot remember the exact context or PR. I think this fix PR may have solved the issue.

@maribu
Copy link
Member Author

maribu commented Nov 25, 2022

Backport provided in #18972

@fabian18
Copy link
Contributor

Yes this fixes Issue #18217! Great!

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: ARM Platform: This PR/issue effects ARM-based platforms Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch 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.

5 participants