mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
hwrng: timeriomem - Fix cooldown period calculation
[ Upstream commite145f5565d
] Ensure cooldown period tolerance of 1% is actually accounted for. Fixes:ca3bff70ab
("hwrng: timeriomem - Improve performance...") Signed-off-by: Jan Henrik Weinstock <jan.weinstock@rwth-aachen.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
6f651ec266
commit
cba03a2961
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ static int timeriomem_rng_read(struct hwrng *hwrng, void *data,
|
|||
*/
|
||||
if (retval > 0)
|
||||
usleep_range(period_us,
|
||||
period_us + min(1, period_us / 100));
|
||||
period_us + max(1, period_us / 100));
|
||||
|
||||
*(u32 *)data = readl(priv->io_base);
|
||||
retval += sizeof(u32);
|
||||
|
|
Loading…
Reference in a new issue