[riot-commits] [RIOT-OS/RIOT] eec7aa: cortexm_common: disable IRQ during thread_sched_idle

Martine Lenders noreply at github.com
Thu Jul 16 15:35:34 CEST 2020


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: eec7aa2e4284ca1884e0b2f680c036bebe69e79e
      https://github.com/RIOT-OS/RIOT/commit/eec7aa2e4284ca1884e0b2f680c036bebe69e79e
  Author: Koen Zandberg <koen at bergzand.net>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M cpu/cortexm_common/thread_arch.c

  Log Message:
  -----------
  cortexm_common: disable IRQ during thread_sched_idle

A race condition is present where an IRQ is serviced between the
priority increase of the PENDSV and the sleep. When the IRQ
is serviced before the WFI sleep, the core will sleep until the next
IRQ and the thread activated by the IRQ will not be scheduled until
a new IRQ triggers.

This commit wraps an IRQ disable and restore around the priority
modification and sleep to prevent interrupts from being serviced until
the WFI call returns.


  Commit: ea8e86761120dde3ff970ad1362acd0d8b15b286
      https://github.com/RIOT-OS/RIOT/commit/ea8e86761120dde3ff970ad1362acd0d8b15b286
  Author: Martine Lenders <m.lenders at fu-berlin.de>
  Date:   2020-07-16 (Thu, 16 Jul 2020)

  Changed paths:
    M cpu/cortexm_common/thread_arch.c

  Log Message:
  -----------
  Merge pull request #14534 from bergzand/pr/cortexm/irq_during_idle

cortexm_common: disable IRQ during thread_sched_idle


Compare: https://github.com/RIOT-OS/RIOT/compare/15110af51c15...ea8e86761120


More information about the commits mailing list