projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a95887
)
hwrng: optee - handle unlimited data rates
author
Jorge Ramirez-Ortiz
<jorge@foundries.io>
Thu, 6 Aug 2020 10:00:09 +0000
(12:00 +0200)
committer
Herbert Xu
<herbert@gondor.apana.org.au>
Fri, 21 Aug 2020 04:45:28 +0000
(14:45 +1000)
Data rates of MAX_UINT32 will schedule an unnecessary one jiffy
timeout on the call to msleep. Avoid this scenario by using 0 as the
unlimited data rate.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/optee-rng.c
patch
|
blob
|
history
diff --git
a/drivers/char/hw_random/optee-rng.c
b/drivers/char/hw_random/optee-rng.c
index
49b2e02
..
5bc4700
100644
(file)
--- a/
drivers/char/hw_random/optee-rng.c
+++ b/
drivers/char/hw_random/optee-rng.c
@@
-128,7
+128,7
@@
static int optee_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
data += rng_size;
read += rng_size;
- if (wait) {
+ if (wait
&& pvt_data->data_rate
) {
if (timeout-- == 0)
return read;
msleep((1000 * (max - read)) / pvt_data->data_rate);