Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5697865rwl; Sun, 8 Jan 2023 20:59:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXv+L6ogW1w3m8nPW1RAHLNXpXZ7UYLi0w+t7/FhakSYg/UNfyGHYunxAG9SaINesL3w8imm X-Received: by 2002:a17:906:22d2:b0:7fc:3787:243d with SMTP id q18-20020a17090622d200b007fc3787243dmr56919942eja.53.1673240366058; Sun, 08 Jan 2023 20:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673240366; cv=none; d=google.com; s=arc-20160816; b=bTYHbvNwY16HHer1ILa6PzYa8vbjADEwKCk/bAA8aNmM9Vs/F81iIU1RJd3Za++UmS 4+B5jA5lZ/rltaUksC9WEUEccaP3m6AfPfYLd4Y1HlppJfslYigrbdXdOW7z/NUi1NOq vFZehHJGN6Mtq9fsrFQryb+1ekxpKbu0yW1ubl+Xaq78XR+obDho/4oEhaVfiQfp7r6T lyqanmmJitsgwSxbkuGgtAfD1usNnWvHxQDOLG2oROBWQTaFDxohVJKlJ0j2N6jM9aBH LLDnVEOHDBWOvao6rGKrlI+AfwRJBC+PHPnrP6/W4EPKJeIU2yRxjBRVq9cAymvYpqMp bwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=HhtOMWVrXGm22sc3dOQrLLgzMxFMyG1/7GboPOGvbnw=; b=t3jhkiSpt2meUQ34XOpjGGHvayuVX1Qmjdzt8g2ebVw1ibqOyEuwjs9jGajeMxLVP6 Ibz2nFTxfElpcw7ggHiH+2YLUUCF5C6FTyedp6PVOUQYf79YRx4ln3TZJMFiYlIAHgma ic2pyEx+7EoxzkGyI+cWUNiOz+41a02imxr1MBskwF5uJsJXDlqDr96dD6d2vYEU7RSx +edJtRwi39iQkxm/1rtEfjkf2TV+1tVdWCgYkW3uGcvvsUMT663X1s18/g0VZffRBYFs atvRrih4edL942SH5J3IzH+2q0giU3VdUI4XtFTtnf+nXW6n4gWoVSI4Y+QFH3sm4h6w I+ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa11-20020a170906fd8b00b007c11812c621si8456889ejb.459.2023.01.08.20.58.55; Sun, 08 Jan 2023 20:59:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236932AbjAIEiq convert rfc822-to-8bit (ORCPT + 99 others); Sun, 8 Jan 2023 23:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236941AbjAIEh6 (ORCPT ); Sun, 8 Jan 2023 23:37:58 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8604513E9E; Sun, 8 Jan 2023 20:33:34 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 9D36224DFF7; Mon, 9 Jan 2023 12:33:27 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 9 Jan 2023 12:33:27 +0800 Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 9 Jan 2023 12:33:27 +0800 Received: from EXMBX168.cuchost.com ([fe80::3c2d:dee5:4938:3fc4]) by EXMBX168.cuchost.com ([fe80::3c2d:dee5:4938:3fc4%16]) with mapi id 15.00.1497.044; Mon, 9 Jan 2023 12:33:27 +0800 From: JiaJie Ho To: Herbert Xu CC: Olivia Mackall , Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Conor Dooley , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" Subject: RE: [PATCH v2 2/3] hwrng: starfive - Add TRNG driver for StarFive SoC Thread-Topic: [PATCH v2 2/3] hwrng: starfive - Add TRNG driver for StarFive SoC Thread-Index: AQHZGoveBWEVWeSp5UqGtlmGFQKs8K6QmY4AgATZceD//3/RgIAAj3Zg//+ATgCAAIa+sA== Date: Mon, 9 Jan 2023 04:33:26 +0000 Message-ID: References: <20221228071103.91797-1-jiajie.ho@starfivetech.com> <20221228071103.91797-3-jiajie.ho@starfivetech.com> <7c2cc6e9cdf241318fc73162a5ec221d@EXMBX168.cuchost.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [202.190.108.220] x-yovoleruleagent: yovoleflag Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > -----Original Message----- > From: Herbert Xu > Sent: 9 January, 2023 12:00 PM > To: JiaJie Ho > Cc: Olivia Mackall ; Rob Herring ; > Krzysztof Kozlowski ; Emil Renner > Berthing ; Conor Dooley ; > linux-crypto@vger.kernel.org; devicetree@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-riscv@lists.infradead.org > Subject: Re: [PATCH v2 2/3] hwrng: starfive - Add TRNG driver for StarFive > SoC > > On Mon, Jan 09, 2023 at 03:41:14AM +0000, JiaJie Ho wrote: > > > > The average wait time is around 20 microseconds. > > I measured from writel cmd to wait_for_completion done. > > Do you know of an upper bound? E.g., if we limit it to 40us how many > requests would fail on average? > I don't have the upper bound. I ran the rngtest with 1000 blocks, none of the wait time exceeded 30us. > Having a maximum delay of 40us would be OK with wait == 0. So you could > implement it in a way such that if the wait time exceeded 40us then you > return if wait == 0, otherwise you can wait longer. > I'll do this then. Thanks Jia Jie