hwrng: stm32 - rework error handling in stm32_rng_read()
authorGatien Chevallier <gatien.chevallier@foss.st.com>
Thu, 21 Sep 2023 08:02:57 +0000 (10:02 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 1 Oct 2023 08:28:15 +0000 (16:28 +0800)
commitb17bc6eb7c2b089f4425b5b656184385acac77fe
tree82a2a61b30ba710e8c98ca314d9f9e5eb8581168
parent8f1c5227eccb4e1c47b30bbe4a63b87535d12674
hwrng: stm32 - rework error handling in stm32_rng_read()

Try to conceal seed errors when possible. If, despite the error
concealing tries, a seed error is still present, then return an error.

A clock error does not compromise the hardware block and data can
still be read from RNG_DR. Just warn that the RNG clock is too slow
and clear RNG_SR.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/stm32-rng.c