Skip to content

Commit bebfe70

Browse files
janweinstockgregkh
authored andcommitted
hwrng: timeriomem - Fix cooldown period calculation
[ Upstream commit e145f55 ] Ensure cooldown period tolerance of 1% is actually accounted for. Fixes: ca3bff7 ("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>
1 parent ca0d825 commit bebfe70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/char/hw_random/timeriomem-rng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static int timeriomem_rng_read(struct hwrng *hwrng, void *data,
6969
*/
7070
if (retval > 0)
7171
usleep_range(period_us,
72-
period_us + min(1, period_us / 100));
72+
period_us + max(1, period_us / 100));
7373

7474
*(u32 *)data = readl(priv->io_base);
7575
retval += sizeof(u32);

0 commit comments

Comments
 (0)