Skip to content

Commit 476e5ea

Browse files
committed
drivers: entropy: gecko_trng: Fully initialize on read
If the TRNG has been unretained, it's not sufficient to enable the clock, it must be fully reinitialized. This is a minimal fix to ensure entropy is accumulated after sleep. Long term, this driver should be made to use device power management with power domain awareness. Signed-off-by: Aksel Skauge Mellbye <[email protected]>
1 parent 1a49b41 commit 476e5ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/entropy/entropy_gecko_trng.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#endif /* _SILICON_LABS_32B_SERIES_2_CONFIG_* */
4545
#endif /* CONFIG_CRYPTO_ACC_GECKO_TRNG */
4646

47+
static int entropy_gecko_trng_init(const struct device *dev);
48+
4749
static void entropy_gecko_trng_read(uint8_t *output, size_t len)
4850
{
4951
#ifndef CONFIG_CRYPTO_ACC_GECKO_TRNG
@@ -77,7 +79,7 @@ static int entropy_gecko_trng_get_entropy(const struct device *dev,
7779
ARG_UNUSED(dev);
7880

7981
#ifdef CONFIG_CRYPTO_ACC_GECKO_TRNG
80-
CMU_ClockEnable(cmuClock_CRYPTOACC, true);
82+
entropy_gecko_trng_init(dev);
8183
#endif
8284

8385
while (length) {

0 commit comments

Comments
 (0)