From: Alex Porosanu Subject: [PATCH 0/7] crypto: caam - RNG4 patches and fixes Date: Mon, 9 Sep 2013 18:56:27 +0300 Message-ID: <1378742194-32194-1-git-send-email-alexandru.porosanu@freescale.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , To: Return-path: Received: from mail-db8lp0184.outbound.messaging.microsoft.com ([213.199.154.184]:58718 "EHLO db8outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753317Ab3IIP7R (ORCPT ); Mon, 9 Sep 2013 11:59:17 -0400 Sender: linux-crypto-owner@vger.kernel.org List-ID: 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