From patchwork Wed Jul 19 07:44:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 9850669 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9598160388 for ; Wed, 19 Jul 2017 07:45:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 843A1285D2 for ; Wed, 19 Jul 2017 07:45:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77A77285FD; Wed, 19 Jul 2017 07:45:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C2A285D2 for ; Wed, 19 Jul 2017 07:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbdGSHpY (ORCPT ); Wed, 19 Jul 2017 03:45:24 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:52923 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbdGSHpX (ORCPT ); Wed, 19 Jul 2017 03:45:23 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dXjfb-00083Q-Fm; Wed, 19 Jul 2017 09:45:19 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1dXjfW-0002Yq-RC; Wed, 19 Jul 2017 09:45:14 +0200 From: Oleksij Rempel To: kernel@pengutronix.de, =?UTF-8?q?Horia=20Geant=C4=83?= , Dan Douglass , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Oleksij Rempel Subject: [PATCH v1] crypto: caam - set hwrng quality level Date: Wed, 19 Jul 2017 09:44:58 +0200 Message-Id: <20170719074458.9247-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According documentation, it is NIST certified TRNG. So, set high quality to let the HWRNG framework automatically use it. Signed-off-by: Oleksij Rempel --- drivers/crypto/caam/caamrng.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c index 41398da3edf4..684c0bc88dfd 100644 --- a/drivers/crypto/caam/caamrng.c +++ b/drivers/crypto/caam/caamrng.c @@ -292,10 +292,16 @@ static int caam_init_rng(struct caam_rng_ctx *ctx, struct device *jrdev) return 0; } +/* + * hwrng register struct + * The trng is suppost to have 100% entropy, and thus + * we register with a very high quality value. + */ static struct hwrng caam_rng = { .name = "rng-caam", .cleanup = caam_cleanup, .read = caam_read, + .quality = 999, }; static void __exit caam_rng_exit(void)