drivers: entropy: nrf5: add docs and a DSB in get_entropy_isr
Add a DSB before doing WFE in get_entropy_isr, 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). Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
a182f74de9
commit
f1264b7e47
1 changed files with 9 additions and 0 deletions
|
@ -290,6 +290,15 @@ static int entropy_nrf5_get_entropy_isr(struct device *dev, uint8_t *buf, uint16
|
|||
|
||||
while (!nrf_rng_event_check(NRF_RNG,
|
||||
NRF_RNG_EVENT_VALRDY)) {
|
||||
/*
|
||||
* To guarantee waking up from the event, the
|
||||
* SEV-On-Pend feature must be enabled (enabled
|
||||
* during ARCH initialization).
|
||||
*
|
||||
* DSB is recommended by spec before WFE (to
|
||||
* guarantee completion of memory transactions)
|
||||
*/
|
||||
__DSB();
|
||||
__WFE();
|
||||
__SEV();
|
||||
__WFE();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue