From patchwork Tue Oct 29 16:29:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 11218133 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 697FE112B for ; Tue, 29 Oct 2019 16:29:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4638720717 for ; Tue, 29 Oct 2019 16:29:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VfQf5upi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390174AbfJ2Q3p (ORCPT ); Tue, 29 Oct 2019 12:29:45 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43805 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389940AbfJ2Q3l (ORCPT ); Tue, 29 Oct 2019 12:29:41 -0400 Received: by mail-pf1-f194.google.com with SMTP id 3so9934593pfb.10; Tue, 29 Oct 2019 09:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FKr4vKOhEd9l/2xWZu8GBMAETT1mfl4IFe4iSbG1JbU=; b=VfQf5upiIF8v62IPwJs7chboED9+F+smukuu3sgZEi888rAcTXqDSa9k4hXBwNfa4L wfPj7zCnn+GWZPp8FTB2Ypygj3+7hLacWDhNhItaHkkyC1IYNs7BfeRjIRZjoRMK7uSo ZItghijFezBszxjx/m+tij/0wTD3SUbodmOq9FWrZ/NJqi/jTgByP9stBNkoFLJAL37U PTXqdWfcvAbpF0v+01Cq2n1OMSSMg2clT4c9irJZMNkb33vAZAlC5j2TI6uyn5vHqzbj vAqxjgg6gb4f4SoaZvLGTbzFl3nxWjG+s0mOBqXIaJ4/pGup2E1xdoFvo803fjR0uvZS TYiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FKr4vKOhEd9l/2xWZu8GBMAETT1mfl4IFe4iSbG1JbU=; b=cfbTy1Dpjm6a+PHUDAg5OWzofuTcxLp2u7VfC+fKog3D9I4wLuRpjuplA0a0Or/opJ MH1T//eTthHI7oA37a3dOTsYPRGQx9N56QRW6iMlHqymi0xqUBH+A2VZ1lw6WWuoGMPn EfPbuW0TCbuJE+Mn97mefbq0Vv/VsE+gmavmv2jVS3fAQ8vNpAO00d465UGB8ZHmjlAh f60CwGXHy58MQPj8A91PCKNCpsM8zrMCadyqr588Gtv5coRS+gEZg+eetQEWqapWfCGt Dno+eEt2KCAXPV2mqzEBd4Vfb5SM7mpE7lsaXCvptd092KNxY99WspPK+BoUUFl5SJdq iHmQ== X-Gm-Message-State: APjAAAWdXWXu5dZ0RK4OI27cQaVZPpOlie4pnkapK0FBKxScLDvEFAIw aX2/Uaxbo02KvRu6LeuILT7qCjW/ X-Google-Smtp-Source: APXvYqwDuTjyXTKBXc1bvJ+pFFNzy7k1K1ngnda1M4eNxfCE5BG2MF7M0rn5GwWDr8Bb/wXA3nDaxQ== X-Received: by 2002:a63:cf4a:: with SMTP id b10mr26880211pgj.86.1572366580610; Tue, 29 Oct 2019 09:29:40 -0700 (PDT) Received: from localhost.lan (c-67-185-54-80.hsd1.wa.comcast.net. [67.185.54.80]) by smtp.gmail.com with ESMTPSA id q184sm15438830pfc.111.2019.10.29.09.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 09:29:39 -0700 (PDT) From: Andrey Smirnov To: linux-crypto@vger.kernel.org Cc: Andrey Smirnov , Aymen Sghaier , Vipul Kumar , Chris Healy , Lucas Stach , =?utf-8?q?Horia_Geant=C4=83?= , Herbert Xu , Iuliana Prodan , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] crypto: caam - RNG4 TRNG errata Date: Tue, 29 Oct 2019 09:29:14 -0700 Message-Id: <20191029162916.26579-2-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191029162916.26579-1-andrew.smirnov@gmail.com> References: <20191029162916.26579-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The TRNG as used in RNG4, used in CAAM has a documentation issue. The effect is that it is possible that the entropy used to instantiate the DRBG may be old entropy, rather than newly generated entropy. There is proper programming guidance, but it is not in the documentation. Signed-off-by: Aymen Sghaier Signed-off-by: Vipul Kumar [andrew.smirnov@gmail.com ported to upstream kernel] Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Herbert Xu Cc: Iuliana Prodan Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/caam/ctrl.c | 11 ++++++++--- drivers/crypto/caam/regs.h | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index d7c3c3805693..df4db10e9fca 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -338,8 +338,12 @@ static void kick_trng(struct platform_device *pdev, int ent_delay) ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl; r4tst = &ctrl->r4tst[0]; - /* put RNG4 into program mode */ - clrsetbits_32(&r4tst->rtmctl, 0, RTMCTL_PRGM); + /* + * Setting both RTMCTL:PRGM and RTMCTL:TRNG_ACC causes TRNG to + * properly invalidate the entropy in the entropy register and + * force re-generation. + */ + clrsetbits_32(&r4tst->rtmctl, 0, RTMCTL_PRGM | RTMCTL_ACC); /* * Performance-wise, it does not make sense to @@ -369,7 +373,8 @@ static void kick_trng(struct platform_device *pdev, int ent_delay) * select raw sampling in both entropy shifter * and statistical checker; ; put RNG4 into run mode */ - clrsetbits_32(&r4tst->rtmctl, RTMCTL_PRGM, RTMCTL_SAMP_MODE_RAW_ES_SC); + clrsetbits_32(&r4tst->rtmctl, RTMCTL_PRGM | RTMCTL_ACC, + RTMCTL_SAMP_MODE_RAW_ES_SC); } static int caam_get_era_from_hw(struct caam_ctrl __iomem *ctrl) diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 05127b70527d..c191e8fd0fa7 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -487,7 +487,8 @@ struct rngtst { /* RNG4 TRNG test registers */ struct rng4tst { -#define RTMCTL_PRGM 0x00010000 /* 1 -> program mode, 0 -> run mode */ +#define RTMCTL_ACC BIT(5) /* TRNG access mode */ +#define RTMCTL_PRGM BIT(16) /* 1 -> program mode, 0 -> run mode */ #define RTMCTL_SAMP_MODE_VON_NEUMANN_ES_SC 0 /* use von Neumann data in both entropy shifter and statistical checker */ From patchwork Tue Oct 29 16:29:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 11218137 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EF4C1515 for ; Tue, 29 Oct 2019 16:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C2072173E for ; Tue, 29 Oct 2019 16:29:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tCfsFakY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728902AbfJ2Q3t (ORCPT ); Tue, 29 Oct 2019 12:29:49 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41216 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390443AbfJ2Q3s (ORCPT ); Tue, 29 Oct 2019 12:29:48 -0400 Received: by mail-pf1-f193.google.com with SMTP id p26so5808947pfq.8; Tue, 29 Oct 2019 09:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gPQwdn4udEXLz4b6rKkGvbQK0FBocCWnK07Y3d1pShE=; b=tCfsFakYTpngHdcCiMx3uSty7t1JC3OuLDFMGE3P2ff2DLkqlmu4nJv6hh3iat91BC ip1E7Rx1tydR5aj3e5Q7dJZzt1y0rNMAh416dMDgFfA99lq7iyrCyVACW5hAHnPoveyh ZvybHGx2TyROIUrR0pWAKBCMB7G2An8ao7Es6UY9y0WdohqLR8OpMqMiu54P5GSYhtN4 n7h3oiFY0m8fRZxyxm/2BVjO/5chm/adlEPQsNHNc2/sVk6JWgkys4vtSIC5P7kbRZvt qRaW0cILHLMY15BD43oTlpy0THiTi2eAIXbUp2lmtXgWxYt2644pIlppu6ebVNGaL8jb yMkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gPQwdn4udEXLz4b6rKkGvbQK0FBocCWnK07Y3d1pShE=; b=Mo1/nvl72WBgMsRCwVdtcjUz/LdF197AWM0xtnaWsayufTHbV9rwgxLNrLOyYo9yLf XGuoKhkDrsnfeA1l8ttNHxVpjL5/uD4/gFjSq3p5Zc+MuCLBciT5IjOTCPHBRtBNxMYi mYYPTLvh+IEyDANImOI4qZkmTV1XWo9jNCLb0qOOwtyxS6iA4fsMUy839pbQEQq+6gCf ONToyucfaxnrOvuah8HvJ9gWtLenvhe3lDG9o2ecdn9wT2VITA8ho/yLkX3LdLDZwktv N/Ue23lomwhu+QeXUuALl1gV+NJY27EetXugA7RNJuuhG/mVpS76kr1UEadHiejoj75W Mvtw== X-Gm-Message-State: APjAAAVchDNbnwXAhaU1Noz197zkIfkbsIL5RrAIiNOnxN1XkCnN9wqS jEXzTYL0pO6vKOqDxatyhPELxICJ X-Google-Smtp-Source: APXvYqy9SvuN2YqfL5rm0zVpO+AAkepcga8wRT7LBxTyPvtcawqY5nv8tC7RjFpKrVFS8K6uBKzHGQ== X-Received: by 2002:a62:1d8d:: with SMTP id d135mr28426970pfd.172.1572366587712; Tue, 29 Oct 2019 09:29:47 -0700 (PDT) Received: from localhost.lan (c-67-185-54-80.hsd1.wa.comcast.net. [67.185.54.80]) by smtp.gmail.com with ESMTPSA id q184sm15438830pfc.111.2019.10.29.09.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 09:29:41 -0700 (PDT) From: Andrey Smirnov To: linux-crypto@vger.kernel.org Cc: Andrey Smirnov , Chris Healy , Lucas Stach , =?utf-8?q?Horia_Geant=C4=83?= , Herbert Xu , Iuliana Prodan , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] crypto: caam - enable prediction resistance in HRWNG Date: Tue, 29 Oct 2019 09:29:15 -0700 Message-Id: <20191029162916.26579-3-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191029162916.26579-1-andrew.smirnov@gmail.com> References: <20191029162916.26579-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Instantiate CAAM RNG with prediction resistance enabled to improve its quality. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Herbert Xu Cc: Iuliana Prodan Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/caam/caamrng.c | 3 ++- drivers/crypto/caam/ctrl.c | 8 +++++--- drivers/crypto/caam/desc.h | 2 ++ drivers/crypto/caam/regs.h | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c index e8baacaabe07..6dde8ae3cd9b 100644 --- a/drivers/crypto/caam/caamrng.c +++ b/drivers/crypto/caam/caamrng.c @@ -202,7 +202,8 @@ static inline int rng_create_sh_desc(struct caam_rng_ctx *ctx) init_sh_desc(desc, HDR_SHARE_SERIAL); /* Generate random bytes */ - append_operation(desc, OP_ALG_ALGSEL_RNG | OP_TYPE_CLASS1_ALG); + append_operation(desc, OP_ALG_ALGSEL_RNG | OP_TYPE_CLASS1_ALG | + OP_ALG_PR_ON); /* Store bytes */ append_seq_fifo_store(desc, RN_BUF_SIZE, FIFOST_TYPE_RNGSTORE); diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index df4db10e9fca..a1c879820286 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -36,7 +36,8 @@ static void build_instantiation_desc(u32 *desc, int handle, int do_sk) init_job_desc(desc, 0); op_flags = OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG | - (handle << OP_ALG_AAI_SHIFT) | OP_ALG_AS_INIT; + (handle << OP_ALG_AAI_SHIFT) | OP_ALG_AS_INIT | + OP_ALG_PR_ON; /* INIT RNG in non-test mode */ append_operation(desc, op_flags); @@ -275,11 +276,12 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, return -ENOMEM; for (sh_idx = 0; sh_idx < RNG4_MAX_HANDLES; sh_idx++) { + const u32 rdsta_mask = (RDSTA_PR0 | RDSTA_IF0) << sh_idx; /* * If the corresponding bit is set, this state handle * was initialized by somebody else, so it's left alone. */ - if ((1 << sh_idx) & state_handle_mask) + if (rdsta_mask & state_handle_mask) continue; /* Create the descriptor for instantiating RNG State Handle */ @@ -302,7 +304,7 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK; if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) || - !(rdsta_val & (1 << sh_idx))) { + (rdsta_val & rdsta_mask) != rdsta_mask) { ret = -EAGAIN; break; } diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam/desc.h index 4b6854bf896a..e796d3cb9be8 100644 --- a/drivers/crypto/caam/desc.h +++ b/drivers/crypto/caam/desc.h @@ -1254,6 +1254,8 @@ #define OP_ALG_ICV_OFF (0 << OP_ALG_ICV_SHIFT) #define OP_ALG_ICV_ON (1 << OP_ALG_ICV_SHIFT) +#define OP_ALG_PR_ON BIT(1) + #define OP_ALG_DIR_SHIFT 0 #define OP_ALG_DIR_MASK 1 #define OP_ALG_DECRYPT 0 diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index c191e8fd0fa7..fe1f8c1409fd 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -524,9 +524,11 @@ struct rng4tst { u32 rsvd1[40]; #define RDSTA_SKVT 0x80000000 #define RDSTA_SKVN 0x40000000 +#define RDSTA_PR0 BIT(4) +#define RDSTA_PR1 BIT(5) #define RDSTA_IF0 0x00000001 #define RDSTA_IF1 0x00000002 -#define RDSTA_IFMASK (RDSTA_IF1 | RDSTA_IF0) +#define RDSTA_IFMASK (RDSTA_PR1 | RDSTA_PR0 | RDSTA_IF1 | RDSTA_IF0) u32 rdsta; u32 rsvd2[15]; }; From patchwork Tue Oct 29 16:29:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 11218135 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91F51112B for ; Tue, 29 Oct 2019 16:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AA4D20874 for ; Tue, 29 Oct 2019 16:29:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DERPfAso" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390345AbfJ2Q3v (ORCPT ); Tue, 29 Oct 2019 12:29:51 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47098 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390443AbfJ2Q3v (ORCPT ); Tue, 29 Oct 2019 12:29:51 -0400 Received: by mail-pg1-f193.google.com with SMTP id f19so9914936pgn.13; Tue, 29 Oct 2019 09:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vqg2XO53IvjvWgpc7maLNfLfFhOvPs8FRtuz3pdvCVg=; b=DERPfAsousKxqjbrr4S0syrTD4bEJpLEcj/4KPbk7Vj6JL14ard9U1nqESZKSeD8C8 vmraCC02uVoOd7YYVtQJFAaqe5ZfgbUhrMbKbjcO/NXqOctLEMMrwNE115O54dq+n61j ScLgs4H2JoLm27tk62ZgR0Opfni67+wiLK/UcgOhRQu9GmjBcBgF3hctpWeooeayrPku Wf/Q3ewL3FG3AfkFCBmT3YMd0Ha+14YgNeS5M8mtVN9z2aWqR6Yr81sIHUyBRQmKf0hK VILIg4xFOLtYfWeOft/JbFkjlmfJr7rhTz29KYrKObbRXPYYqAJBfrWyrhlrFFXK6e8m mFUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vqg2XO53IvjvWgpc7maLNfLfFhOvPs8FRtuz3pdvCVg=; b=D1qEi/rzp8b8jO0icf+1fli0MhurRlBMp4R3hMlXOe7LSE7tmZuz0Sr3jEKaa21QK/ 7eINX3+ZbaqLiX+EW8oO4HzIpNJXzruuFGdVpkWoIgWcVx6fL+WaPB2SuWdyV5EtTySJ 1rL1Fwrzke1da+g27VfFZbMFG8/17WW9apSM3ial9VmEvNdy+5pilEvtsAuqiPzNFeMK gZKY9U+5S0MEirF9mxTPD8u0/6aiplSq6Dy5APtyeYB9/LHd1BY7n4jVPuGpgdoQU6F7 ctupz7iIZaXqTTrvbd5HcX3ir7hefF4akxd1V84o6J18686sRRgr4J2cPK/4sxJCNYbP 0P3Q== X-Gm-Message-State: APjAAAVMzYR9rjwh5vMOCZS/0qLxUaHVmzpAjh5bovZ9ZwS6hu9PKHgs 0qWBuVkHU8RKFEVUlQ9a9d36bxXT X-Google-Smtp-Source: APXvYqx0d7zbeVn2QQiUDFBYa6ephjiwPGTAz86ixSpuJp8MbcAIdR7pGce2gd3W5YEfU+OzcaYGjw== X-Received: by 2002:a62:3441:: with SMTP id b62mr27154063pfa.12.1572366589916; Tue, 29 Oct 2019 09:29:49 -0700 (PDT) Received: from localhost.lan (c-67-185-54-80.hsd1.wa.comcast.net. [67.185.54.80]) by smtp.gmail.com with ESMTPSA id q184sm15438830pfc.111.2019.10.29.09.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 09:29:48 -0700 (PDT) From: Andrey Smirnov To: linux-crypto@vger.kernel.org Cc: Andrey Smirnov , Oleksij Rempel , Chris Healy , Lucas Stach , =?utf-8?q?Horia_Geant=C4=83?= , Herbert Xu , Iuliana Prodan , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] crypto: caam - set hwrng quality level Date: Tue, 29 Oct 2019 09:29:16 -0700 Message-Id: <20191029162916.26579-4-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191029162916.26579-1-andrew.smirnov@gmail.com> References: <20191029162916.26579-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Set high quality to let the HWRNG framework automatically use it. Signed-off-by: Oleksij Rempel Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Horia Geantă Cc: Herbert Xu Cc: Iuliana Prodan Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/crypto/caam/caamrng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c index 6dde8ae3cd9b..23a573ea6cdb 100644 --- a/drivers/crypto/caam/caamrng.c +++ b/drivers/crypto/caam/caamrng.c @@ -299,6 +299,7 @@ static struct hwrng caam_rng = { .name = "rng-caam", .cleanup = caam_cleanup, .read = caam_read, + .quality = 999, }; void caam_rng_exit(void)