[riot-notifications] [RIOT] sys/xtimer: Avoid race incrementing multiple periods in _timer_callback (#3998)

Joakim Nohlgård notifications at github.com
Wed Sep 30 10:27:42 CEST 2015


On a fast CPU with a slow timer (e.g. XTIMER_SHIFT > 0) it is possible
that now == _xtimer_now() when spinning for the overflow. In the extreme
case When this happens _next_period() will be called more than once
until the timer overflows for real.

Fault observed in real life when running on a 32.768 kHz timer on a
~96 MHz clocked mulle (Kinetis K60, Cortex-M4). _next_period() was
called 9 times during the same ISR call before the 32 kHz timer
overflowed.
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/3998

-- Commit Summary --

  * sys/xtimer: Avoid race incrementing multiple periods in _timer_callback

-- File Changes --

    M sys/xtimer/xtimer_core.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/3998.patch
https://github.com/RIOT-OS/RIOT/pull/3998.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3998
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150930/cd856d65/attachment-0001.html>


More information about the notifications mailing list