Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: caam - double the entropy delay interval for retry

during entropy evaluation, if the generated samples fail
any statistical test, then, all of the bits will be discarded,
and a second set of samples will be generated and tested.

the entropy delay interval should be doubled before performing the
retry.

also, ctrlpriv->rng4_sh_init and inst_handles both reads RNG DRNG
status register, but only inst_handles is updated before every retry.
so only check inst_handles and removing ctrlpriv->rng4_sh_init

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Gaurav Jain and committed by
Herbert Xu
9048beca 4fcd3229

+2 -2
+2 -2
drivers/crypto/caam/ctrl.c
··· 703 703 */ 704 704 if (needs_entropy_delay_adjustment()) 705 705 ent_delay = 12000; 706 - if (!(ctrlpriv->rng4_sh_init || inst_handles)) { 706 + if (!inst_handles) { 707 707 dev_info(dev, 708 708 "Entropy delay = %u\n", 709 709 ent_delay); 710 710 kick_trng(dev, ent_delay); 711 - ent_delay += 400; 711 + ent_delay = ent_delay * 2; 712 712 } 713 713 /* 714 714 * if instantiate_rng(...) fails, the loop will rerun