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

Martine Lenders noreply at github.com
Thu Jul 16 18:18:33 CEST 2020


  Branch: refs/heads/2020.07-branch
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: d023c70b0605d18829f2ff010a189757d666b7b5
      https://github.com/RIOT-OS/RIOT/commit/d023c70b0605d18829f2ff010a189757d666b7b5
  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.

(cherry picked from commit eec7aa2e4284ca1884e0b2f680c036bebe69e79e)


  Commit: ab072f2987d5260d81df20d69c4e34396e381ebc
      https://github.com/RIOT-OS/RIOT/commit/ab072f2987d5260d81df20d69c4e34396e381ebc
  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 #14537 from bergzand/backport/2020.07/pr/cortexm/irq_during_idle

cortexm_common: disable IRQ during thread_sched_idle [backport 2020.07]


Compare: https://github.com/RIOT-OS/RIOT/compare/172a3ba71f0a...ab072f2987d5


More information about the commits mailing list