From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFDECC3DA49 for ; Wed, 17 Jul 2024 02:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OzoFypoS95RVnsSNqAfNHnfcgBYHcs3QrD8rqWhHXiE=; b=T2HYtIywvZjhWZzye5ubpDncTZ USLTEyfovjgtYZLhSmLa5N48A5yQoEqQSHzNshMouzm3eZbQIb0Yazd53YfB9J9e6EOqw61MmyrbN NbdpOAUCSxv8h08v2QD+WN+A5e4QbkEpVcYvEF4wZ9UzmcpKWZtjmG05GbwMcXKDVPxFD2qQXKrNl ql8nfCEhpSxbTNM+ji1EJKodgJH5ey3ML/Eu71C/uiIGwSanhQxCmE02rrOPvNe3wh/6mrLZ5f9no rrMOgWugf2re1eIEzKvu8x503Xwi1xVMRDwUJWQWfaeSMdA6j+/B6J5nGqPKqYVUufrBe4QHEw2dC 3rn+7MIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTuMI-0000000CLxH-3VAQ; Wed, 17 Jul 2024 02:25:34 +0000 Received: from pidgin.makrotopia.org ([2a07:2ec0:3002::65]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTuLx-0000000CLsa-1dsK; Wed, 17 Jul 2024 02:25:15 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.97.1) (envelope-from ) id 1sTuLk-000000006Cr-1FJG; Wed, 17 Jul 2024 02:25:00 +0000 Date: Wed, 17 Jul 2024 03:24:55 +0100 From: Daniel Golle To: Diederik de Haas Cc: Chen-Yu Tsai , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Rob Herring , Conor Dooley , linux-kernel@vger.kernel.org, Herbert Xu , Martin Kaiser , Sascha Hauer , Sebastian Reichel , Ard Biesheuvel , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , devicetree@vger.kernel.org, linux-crypto@vger.kernel.org, Philipp Zabel , Olivia Mackall , Krzysztof Kozlowski , Dragan Simic , Aurelien Jarno , Heiko Stuebner , Anand Moon Subject: Re: [PATCH v7 0/3] hwrng: add hwrng support for Rockchip RK3568 Message-ID: References: <3190961.CRkYR5qTbq@bagend> <3220752.Q7WYUMVHaa@bagend> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <3220752.Q7WYUMVHaa@bagend> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240716_192513_476788_9E79AB47 X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 16, 2024 at 07:19:35PM +0200, Diederik de Haas wrote: > On Tuesday, 16 July 2024 18:53:43 CEST Diederik de Haas wrote: > > rngtest: FIPS 140-2(2001-10-10) Long run: 0 >=20 > I don't know if it means something, but I noticed that I have > ``Long run: 0`` with all my poor results, > while Chen-Yu had ``Long run: 1``. >=20 > Different SoC (RK3399), but Anand had ``Long run: 0`` too on their > very poor result (100% failure): > https://lore.kernel.org/linux-rockchip/CANAwSgTTzZOwBaR9zjJ5VMpxm5BydtW6r= B2S7jg+dnoX8hAoWg@mail.gmail.com/ The conclusions I draw from that rather ugly situation are: - The hwrng should not be enabled by default, but it should by done for each board on which it is known to work well. - RK_RNG_SAMPLE_CNT as well as the assumed rng quality should be defined in DT for each board: * introduce new 'rochchip,rng-sample-count' property * read 'quality' property already used for timeriomem_rng I will prepare a follow-up patch taking those conclusions into account. Just for completeness, here my test result on the NanoPi R5C: root@OpenWrt:~# cat /dev/hwrng | rngtest -c 1000 rngtest 6.15 Copyright (c) 2004 by Henrique de Moraes Holschuh This is free software; see the source for copying conditions. There is NO = warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. rngtest: starting FIPS tests... rngtest: bits received from input: 20000032 rngtest: FIPS 140-2 successes: 875 rngtest: FIPS 140-2 failures: 125 rngtest: FIPS 140-2(2001-10-10) Monobit: 123 rngtest: FIPS 140-2(2001-10-10) Poker: 5 rngtest: FIPS 140-2(2001-10-10) Runs: 4 rngtest: FIPS 140-2(2001-10-10) Long run: 0 rngtest: FIPS 140-2(2001-10-10) Continuous run: 0 rngtest: input channel speed: (min=3D85.171; avg=3D141.102; max=3D4882812.5= 00)Kibits/s rngtest: FIPS tests speed: (min=3D17.809; avg=3D19.494; max=3D60.169)Mibits= /s rngtest: Program run time: 139628605 microseconds