Skip to content

Commit 775ebfa

Browse files
cvinayakrlubos
authored andcommitted
[nrf fromtree] Bluetooth: Controller: Add a DSB in sleep interface
Add a DSB before doing WFE in cpu_sleep(), to ensure the memory transactions are complete. Add a note clarifying a dependency for the existing solution (dependency is satisfied by ARCH code but is good to state clearly). Relates to commit f1264b7 ("drivers: entropy: nrf5: add docs and a DSB in get_entropy_isr"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]> (cherry picked from commit 67fa62f) Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 65a9969 commit 775ebfa

File tree

1 file changed

+9
-0
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5

1 file changed

+9
-0
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/cpu.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ static inline void cpu_sleep(void)
1111
defined(CONFIG_CPU_CORTEX_M4) || \
1212
defined(CONFIG_CPU_CORTEX_M33) || \
1313
defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
14+
/*
15+
* To guarantee waking up from the event, the
16+
* SEV-On-Pend feature must be enabled (enabled
17+
* during ARCH initialization).
18+
*
19+
* DSB is recommended by spec before WFE (to
20+
* guarantee completion of memory transactions)
21+
*/
22+
__DSB();
1423
__WFE();
1524
__SEV();
1625
__WFE();

0 commit comments

Comments
 (0)