crypto: caam - optimize RNG sample size
authorMeenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Mon, 12 Jun 2023 08:30:42 +0000 (10:30 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Jun 2023 08:15:36 +0000 (16:15 +0800)
commit1abc89661ad3cd18d8c6af5c2584bcc63df43bf2
tree7d0585582faaf5bf5b472fceea11fc6ad60d0bd9
parent2be0d806e25e7b068113187f9245575914daf0dc
crypto: caam - optimize RNG sample size

TRNG "sample size" (the total number of entropy samples that will be taken
during entropy generation) default / POR value is very conservatively
set to 2500.

Let's set it to 512, the same as the caam driver in U-boot
(drivers/crypto/fsl_caam.c) does.

This solves the issue of RNG performance dropping after a suspend/resume
cycle on parts where caam loses power, since the initial U-boot setttings
are lost and kernel does not restore them when resuming.

Note: when changing the sample size, the self-test parameters need to be
updated accordingly.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/regs.h