Skip to content
Commit 7f82b6a2 authored by Morten Priess's avatar Morten Priess Committed by Carles Cufí
Browse files

Bluetooth: controller: Prevent invalid compiler code reordering



In ull_disable, it is imperative that the callback is set up before a
second reference counter check, otherwise it may happen that an LLL done
event has already passed when the disable callback and semaphore is
assigned.

This causes the HCI thread to wait until timeout and assert after
ull_ticker_stop_with_mark.

For certain compilers, due to compiler optimizations, it can be seen
from the assembler code that the callback is assigned after the second
reference counter check.

By adding memory barriers, the code correctly reorders code to the
expected sequence.

Signed-off-by: default avatarMorten Priess <mtpr@oticon.com>
parent d397aae0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment