drivers: entropy: nrf5: Fix ENTROPY_BUSYWAIT from hanging

Missing clear pending RNG_IRQn when generating multiple
random numbers caused CPU to hang at __WFE call in the
loop waiting for new value.

This fixes commit ddb7f88f9e ("drivers: entropy: nrf5: Fix
ENTROPY_BUSYWAIT implementation")

Fixes #9523.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2018-09-03 11:09:28 +02:00 committed by Carles Cufí
parent 697919c5ba
commit 1359992d1a

View file

@ -297,6 +297,8 @@ static int entropy_nrf5_get_entropy_isr(struct device *dev, u8_t *buf, u16_t len
buf[--len] = NRF_RNG->VALUE; buf[--len] = NRF_RNG->VALUE;
NRF_RNG->EVENTS_VALRDY = 0; NRF_RNG->EVENTS_VALRDY = 0;
NVIC_ClearPendingIRQ(RNG_IRQn);
} while (len); } while (len);
nrf_rng_task_trigger(NRF_RNG_TASK_STOP); nrf_rng_task_trigger(NRF_RNG_TASK_STOP);