From patchwork Thu May 14 19:07:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11549485 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 8D146618 for ; Thu, 14 May 2020 19:07:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7027D206F1 for ; Thu, 14 May 2020 19:07:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="OuKiGx3+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbgENTHo (ORCPT ); Thu, 14 May 2020 15:07:44 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57881 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730191AbgENTHm (ORCPT ); Thu, 14 May 2020 15:07:42 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200514190740euoutp011dbb1fc03e98972092edde91c83324d2~O_pqQ8jha1498914989euoutp01D for ; Thu, 14 May 2020 19:07:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200514190740euoutp011dbb1fc03e98972092edde91c83324d2~O_pqQ8jha1498914989euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589483260; bh=0ZTSEZCdZQmmB3Cuf4f7fDeYUffZn+GsVAdbdhxdQ5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OuKiGx3+2JiS7BvGECbc+jyku4zGJDdZ5m9YG4MSrDREE8kitFBoCiuKvlLcDxUH9 YnbokNDaW6Q0hzI2Dt9bpZzNBO1N0UyWvHpF+MRnADy0789en/GHNQVv1/PTX1sxbT BrQB4/l8t1uFnMNAydoZU2919kid093HrwTW2Y3s= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200514190739eucas1p128e1f360ca382919779973520cc2d026~O_ppzoPtB2658126581eucas1p1E; Thu, 14 May 2020 19:07:39 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id D4.98.60698.BF69DBE5; Thu, 14 May 2020 20:07:39 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200514190738eucas1p2695c0d8af064ee702209ca03696ef438~O_po-9KUX0444904449eucas1p2n; Thu, 14 May 2020 19:07:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200514190738eusmtrp1af5f742bc66af38419c76ed7d1f90ba7~O_po55Wqj2577025770eusmtrp1n; Thu, 14 May 2020 19:07:38 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-b3-5ebd96fb75c4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D4.BE.07950.AF69DBE5; Thu, 14 May 2020 20:07:38 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200514190738eusmtip1e02e9ee08457f754ba2db3422c2673cc~O_pordu_C0350703507eusmtip1P; Thu, 14 May 2020 19:07:38 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Kukjin Kim , Krzysztof Kozlowski , Florian Fainelli , Markus Elfring , Matthias Brugger , Stefan Wahren , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , =?utf-8?q?=C5=81uk?= =?utf-8?q?asz_Stelmach?= Subject: [PATCH 1/2] hwrng: iproc-rng200 - Set the quality value Date: Thu, 14 May 2020 21:07:33 +0200 Message-Id: <20200514190734.32746-2-l.stelmach@samsung.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200514190734.32746-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUyMcRz363ntOD1d0Vde2o7mZVNZzX7mEGN7Zmb+sDGrOHp2opI7Hdm8 hd670qG6iqaoJR1355YoLVS0ujAulkLpzbJZjM5LunvO+O/z/X7eft/txxKyCcqfjYk/JKjj lbFyWkJam8c7lv64WB8VYutdhH/lNTP4VoGRwjeyH5HYll5BYMenhww+XWakcebIHJzT95HA NttNBr9qqkTY1PeSwr094x74eV0xjQtsDR64VN9P4VKrDuEPhWYaf7rej3BLazoR7sP/cOQh 3tDbTvN3DG8Yvsx0n+atjYG8qSqd5u+XVDO8ufwEr7NUIV43fBPxRssLkk9+kkrxY6Z5W6Q7 JIpoITZGK6iDV++S7L2m+0glXGaOPJ/IJE+ic3QG8mSBC4PfFrsLy7hKBA+uqDOQZBJ/QTDR ncaIwxiCnqed1F/Hpc/lpEhUIMhPLXQPgwiGB+4gp4rm1kLO1VbKSfhyZynQf84lnQTBHYaz 7/pdUT5cOJhSslzlJBcI1okXrr2UWwm5BTnuugAoOtXm0nhyCrAPOTxEjTc8Lux3ZXpxS6A6 2e7OD4DTt4sIZzFwjSz0vi93X7oeUh70uLEPjLRYGBHPgTZ91qSZncQnQJ+3XPRmIbAWfydF zUro7nDQTg3BLQZjXbC4Xgv6y88Y0Toduka9xSdMhzxrPiGupZCWIhPVC6Am55470B+yRypR LpIb/jvG8N8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czEoivH7rd8cJ 8aYkVlalFuXHF5XmpBYfYjQFenMis5Rocj4waeWVxBuaGppbWBqaG5sbm1koifN2CByMERJI TyxJzU5NLUgtgulj4uCUamDc6Bnd/f4Rb9E2S0XxfoavT97lrJYWeJGavOdAdc+3T//EbX4r 9VfbL/mudnfGjQjz39v11dL3Fc68rXlzVpTNmhNbXp3gUbnf0fNthXi8zYL/n82+xF6X1Ant zpssuejVnsMrInhTuZSfV802Ud0nz/I8pPGf8tfqzrwLTBOPlX6z3PlkU/0JJZbijERDLeai 4kQAVkcDliIDAAA= X-CMS-MailID: 20200514190738eucas1p2695c0d8af064ee702209ca03696ef438 X-Msg-Generator: CA X-RootMTR: 20200514190738eucas1p2695c0d8af064ee702209ca03696ef438 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200514190738eucas1p2695c0d8af064ee702209ca03696ef438 References: <20200514190734.32746-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The value has been estimaded by obtainig 1024 chunks of data 128 bytes (1024 bits) each from the generator and finding chunk with minimal entropy using the ent(1) tool. The value was 6.327820 bits of entropy in each 8 bits of data. Signed-off-by: Łukasz Stelmach --- drivers/char/hw_random/iproc-rng200.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char/hw_random/iproc-rng200.c index 32d9fe61a225..7eb02a23f744 100644 --- a/drivers/char/hw_random/iproc-rng200.c +++ b/drivers/char/hw_random/iproc-rng200.c @@ -199,6 +199,7 @@ static int iproc_rng200_probe(struct platform_device *pdev) priv->rng.read = iproc_rng200_read, priv->rng.init = iproc_rng200_init, priv->rng.cleanup = iproc_rng200_cleanup, + priv->rng.quality = 800, /* Register driver */ ret = devm_hwrng_register(dev, &priv->rng); From patchwork Thu May 14 19:07:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11549487 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 244AE618 for ; Thu, 14 May 2020 19:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0594A206D8 for ; Thu, 14 May 2020 19:07:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="L72k8lV6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730117AbgENTHx (ORCPT ); Thu, 14 May 2020 15:07:53 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38664 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730199AbgENTHn (ORCPT ); Thu, 14 May 2020 15:07:43 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200514190741euoutp02abd9eae196f5b8f4637440847e542802~O_prcpj_y0495004950euoutp02V for ; Thu, 14 May 2020 19:07:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200514190741euoutp02abd9eae196f5b8f4637440847e542802~O_prcpj_y0495004950euoutp02V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589483261; bh=ZtfxDhdLs90OyvVegf5gSIpg3nb7fV8VW4Z3SaViPnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L72k8lV60AbOjZg4Ks2+xX2iK3uN69F1iHAeMmo4D7spNYxMf2Blvth3ZPDEEneU9 il3Jyq0CqykA+cqzRud5bB9/6A4Sjrw+MdE4NgD1koZYJt30BBbe54oGaI5EUBhQxh omjPKPB4HL462umdcropg/8mf4yx1V6zd30p3i9s= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200514190740eucas1p1b78f50aa2a8c350a702be990ef03efe9~O_pqww51q0232902329eucas1p1_; Thu, 14 May 2020 19:07:40 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 7B.D4.61286.CF69DBE5; Thu, 14 May 2020 20:07:40 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200514190740eucas1p293129b2ef3ba706652a9327e55db9649~O_pqCM4Hi0297902979eucas1p21; Thu, 14 May 2020 19:07:40 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200514190740eusmtrp1551cbba1be4f614ee676bbff1259ef18~O_pqBgBsy2577025770eusmtrp1o; Thu, 14 May 2020 19:07:40 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-df-5ebd96fc26b3 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 16.BE.07950.BF69DBE5; Thu, 14 May 2020 20:07:39 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200514190739eusmtip2b58bea1e9cfb3ef1c0fcca3c010eee29~O_pp2e-ro1760217602eusmtip2F; Thu, 14 May 2020 19:07:39 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Kukjin Kim , Krzysztof Kozlowski , Florian Fainelli , Markus Elfring , Matthias Brugger , Stefan Wahren , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , =?utf-8?q?=C5=81uk?= =?utf-8?q?asz_Stelmach?= Subject: [PATCH 2/2] hwrng: exynos - Set the quality value Date: Thu, 14 May 2020 21:07:34 +0200 Message-Id: <20200514190734.32746-3-l.stelmach@samsung.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200514190734.32746-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUzMcRjf934v9+vW1a+L9ayMuZVN81Jj7RstjM1vtuRPY+Lwk+htd73Q H6S63lC5K9UVWoXW2+XkKJGu00mrNiEqFHkpFIWUMt39zvjveZ7P2/NsD0PIEml3JiwyhldG KsLltIQ0tk13rZw9fyfEJz13JZ7TtInxtQI9hWvO3idxd8ZVAs+MmcU4uUxP49Oji3D2m48E 7u6uE+PnpgqEDW+eUvjVy2kR7mkspnFB910RLtEOU7jEmIXw28LrNB6rGkbY8iCD2OjK/ZrR IE73qpPmGnQvxFyZoZnmjPe8OENlBs01X6gWc9fLT3JZ9ZWIyxqpQ5y+/gnJJT1Mo7hJw+Id 0l2SgIN8eFgcr1wduE9y+MWcGUVni4/1F78jE1ESnYkcGGDXgrr0McpEEkbGViD4NN5LCs03 BKcbau3IJIIecy76K7lUmUYJwFUEX/Jb7M17BHM1jTYWzW6C7MsPbMACVk2B9msOaQUINh7U Q8OUtXZl10FWVxNhrUnWC1L6p21bSdn10P7rnliIWwJFpzpscwc2AHo/zIgEjgu0Fw7bPJ1Z b6hO6rX7L4HkG0WENRhYMwMX6lNFgtEWaHh00X6DK4xa6u0Bi6BDe2ZezMzXJ0Gr8RO0ZxAY i3+SAmc9DHTN0FYOwS4HfeNqYbwJqt5PIUHqBM8+uwgrOIHGmE8IYymkp8oEtifUZjfZDd3h 7GgFykFy3X/H6P47QPcvqwQRlciNj1VFhPIq30g+fpVKEaGKjQxddSAqwoDm/7Ljt2XiFvr+ aL8JsQySO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koifN2CByM ERJITyxJzU5NLUgtgulj4uCUamA0yDu9I/q3DtOHdw8nizxJWCC3YXNlQ9jxECu9IxZMR7PU wkNarYL+CZcUfwh94Ln33O/Px68LfFt2+JmU3W7O2buN3nktPq+yNi0v89Ldl2fey14OX+xV 2uDQ8iUz+tyjjqyMRxHXZQ22zelcGTJX6P3RSIY/5+07Dz2UvbhDcn3GHiGlOw/UlFiKMxIN tZiLihMBTXD5ViIDAAA= X-CMS-MailID: 20200514190740eucas1p293129b2ef3ba706652a9327e55db9649 X-Msg-Generator: CA X-RootMTR: 20200514190740eucas1p293129b2ef3ba706652a9327e55db9649 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200514190740eucas1p293129b2ef3ba706652a9327e55db9649 References: <20200514190734.32746-1-l.stelmach@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The value has been estimaded by obtainig 1024 chunks of data 128 bytes (1024 bits) each from the generator and finding chunk with minimal entropy using the ent(1) tool. The value was 6.332937 bits of entropy in each 8 bits of data. Signed-off-by: Łukasz Stelmach --- drivers/char/hw_random/exynos-trng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c index 8e1fe3f8dd2d..ff6739272bf5 100644 --- a/drivers/char/hw_random/exynos-trng.c +++ b/drivers/char/hw_random/exynos-trng.c @@ -123,6 +123,7 @@ static int exynos_trng_probe(struct platform_device *pdev) trng->rng.init = exynos_trng_init; trng->rng.read = exynos_trng_do_read; trng->rng.priv = (unsigned long) trng; + trng->rng.quality = 800; platform_set_drvdata(pdev, trng); trng->dev = &pdev->dev;