This patch series attempts to fix some identified issues and add some new functionalities regarding the RNG4 block in the CAAM driver: o if the CAAM driver isn't properly instantiated (e.g. RNG4 initialization fails), then there's an illegal memory access generated by the modules depending on it; patch 1 in the patch-set fixes this; o if the CAAM module is removed, the state handles are not uninstantiated; patch 3 in the patch-set adds the necessary descriptor to uninstantiate state handle 0; o the RNG4 block in CAAM needs to be 'seeded' first before being used for generating pseudo-random data. The 'seeding' is done by getting entropy from the TRNG ring oscillator. The RTFRQMAX register controls the maximum allowable number of samples that can be acquired during an entropy sample. Depending on the clock at which the RNG4 block (and for that matter the SEC block) runs, it's possible that a hard-coded value for the maximum frequency is inadequate, i.e. more samples than needed are taken. This leads to failures on devices like BSC913x. Patch number 2 fixes this issue by using a kind of a software loop to increase the maximum number of samples taken until the state handle can be properly initialized; o there are two state handles present in the RNG4 block and only one is initialized; patch 5 in the patch-set fixes this issue, also adding the necessary code for deinstantiation only the handles that were instantiated by the driver. Alex Porosanu (7): crypto: caam - fix RNG state handle instantiation descriptor crypto: caam - fix hash, alg and rng registration if CAAM driver not initialized crypto: caam - fix RNG4 instantiation crypto: caam - split RNG4 instantiation function crypto: caam - uninstantiate RNG state handle 0 if instantiated by caam driver crypto: caam - fix RNG4 AAI defines crypto: caam - enable instantiation of all RNG4 state handles drivers/crypto/caam/caamalg.c | 7 + drivers/crypto/caam/caamhash.c | 7 + drivers/crypto/caam/caamrng.c | 7 + drivers/crypto/caam/ctrl.c | 400 +++++++++++++++++++++++++++++++--------- drivers/crypto/caam/desc.h | 17 +- drivers/crypto/caam/intern.h | 6 + drivers/crypto/caam/regs.h | 14 +- 7 files changed, 364 insertions(+), 94 deletions(-) -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html