ztimer/periodic: reinit remove from right clock and handle aquired ztimer#19826
ztimer/periodic: reinit remove from right clock and handle aquired ztimer#19826bors[bot] merged 1 commit intoRIOT-OS:masterfrom
Conversation
ba1d5f9 to
c4c555f
Compare
|
upgraded this to bug, since restart is documented but leaves a wrong ztimer_aquire/release count without this PR (since it isn't tracking correctly unless the same number for starts and stops happen) RIOT/sys/include/ztimer/periodic.h Line 122 in b482a71 |
benpicco
left a comment
There was a problem hiding this comment.
I think this makes sense, but uncrustify is not happy (and rightfully so)
c4c555f to
abecdd0
Compare
sys/ztimer/periodic.c
Outdated
| ztimer_remove(timer->clock, &timer->timer); | ||
| ztimer_release(timer->clock); | ||
| timer->timer.arg = NULL; |
There was a problem hiding this comment.
Should we also do this (other than the ztimer_remove()) inside _ztimer_periodic_callback() for the !ZTIMER_PERIODIC_KEEP_GOING case?
Why is ztimer_acquire()/ztimer_release() needed here when we do a ztimer_set() anyway?
There was a problem hiding this comment.
Why is ztimer_acquire()/ztimer_release() needed here when we do a ztimer_set() anyway?
atm it needs the aquire (at least for start), but maybe we can rewrite it
abecdd0 to
957021e
Compare
|
How about this but now it should be tested did that -> failed added |
957021e to
a2054e8
Compare
b9ab8aa to
1cb9bcf
Compare
- not ztimer_now calls outsid irq -> remove aquire
1cb9bcf to
4f2237d
Compare
kaspar030
left a comment
There was a problem hiding this comment.
I'm fine here generally, didn't do any testing.
ACK
|
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
#19806 added some retinit handling for ztimer periodic removing the timer from the new clock
This tries to detect if this is a reinit and remove the timer from the old clock
this also removes the ztimer_acquire/_release handling by removing now calls in favour of set return value and now values that are allready in ztimer,
that also has the potential to reduce the jitter of the periodic calls and bus-usage (for cpus that take their time to get "now")
Testing procedure
read
run tests/sys/ztimer_periodic
Issues/PRs references
Fixes #19806