projects
/
platform
/
kernel
/
linux-rpi3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b15c626
)
bcm2835-rng: Avoid initialising if already enabled
author
popcornmix
<popcornmix@gmail.com>
Tue, 6 Dec 2016 17:05:39 +0000
(17:05 +0000)
committer
popcornmix
<popcornmix@gmail.com>
Mon, 13 May 2019 23:07:52 +0000
(
00:07
+0100)
Avoids the 0x40000 cycles of warmup again if firmware has already used it
drivers/char/hw_random/bcm2835-rng.c
patch
|
blob
|
history
diff --git
a/drivers/char/hw_random/bcm2835-rng.c
b/drivers/char/hw_random/bcm2835-rng.c
index
6767d96
..
186fe2f
100644
(file)
--- a/
drivers/char/hw_random/bcm2835-rng.c
+++ b/
drivers/char/hw_random/bcm2835-rng.c
@@
-105,8
+105,10
@@
static int bcm2835_rng_init(struct hwrng *rng)
}
/* set warm-up count & enable */
- rng_writel(priv, RNG_WARMUP_COUNT, RNG_STATUS);
- rng_writel(priv, RNG_RBGEN, RNG_CTRL);
+ if (!(rng_readl(priv, RNG_CTRL) & RNG_RBGEN)) {
+ rng_writel(priv, RNG_WARMUP_COUNT, RNG_STATUS);
+ rng_writel(priv, RNG_RBGEN, RNG_CTRL);
+ }
return ret;
}