hwrng: bcm2835 - sleep more intelligently
authorPhil Elwell <phil@raspberrypi.com>
Wed, 22 Mar 2023 15:30:38 +0000 (15:30 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:29 +0000 (11:33 +0000)
commit91e42f0f1189faad1c4342012e0ad6f3cb0b5eb1
treee0ad31154327cf7cc5a3e75f9ea2a31d4ec0776c
parent62d214537bc284df4fac62232520f4a6308285af
hwrng: bcm2835 - sleep more intelligently

While waiting for random data, use sleeps that are proportional
to the amount of data expected. Prevent indefinite waits by
giving up if nothing is received for a second.

See: https://github.com/raspberrypi/linux/issues/5390

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/char/hw_random/bcm2835-rng.c