Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5643990rwl; Sun, 8 Jan 2023 19:46:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAuY4F0wB+MijATlld21b0cmFiugH2q5am92Ldh3uwIEAMgBBmlFJ4CsPWz/FHuw7GaxzQ X-Received: by 2002:a17:907:9c08:b0:78d:f454:ba4a with SMTP id ld8-20020a1709079c0800b0078df454ba4amr41542914ejc.73.1673235963156; Sun, 08 Jan 2023 19:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673235963; cv=none; d=google.com; s=arc-20160816; b=Hr/LC8TpDZSGGUoetIRHfZ2Mr0+QgdCP08OVzdV16UQsxbtpPAZi5AFbEi6i0WvPXO mH3uUIulC827xvWJFXBA05nJLXNy8HqSioU2XfTTsgLY/paUq2nanr/FVkHzEhziXh+w XMwzj673T5KhL8Pz+JRmF8Pr9h+Fz52dnwAozGIHQAT2IbvKMAwcCMeGjzSZ0j59QeyB EgYU+1PP9MgmaILEKMSIwseNasfc8Lew3xHMAyugagKClDih2hz2W6R2n9xh3rCoIdmO H3GZysxdY7EA7gmSHs8ubVFDwyJngCOwpGP3VTmeSlF8a14F6t0CxDaql6f7Tuy8P7ib m90g== 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=WBpc0kyThqPu0QpFz1oeBVHnoltLipQyjDV9V5x+5DA=; b=GxPB15FETsSD/8OTSybs3Uyke1B4ZNAt/XVLZIYfC7fK5UpvvNZ722fkLlluBlcgPC 25WNinCaLcDMcprofoPJ2SKQ5ByX3oHkARdArTUn1YU1rQ8JDCGcH5Q3VfHILO5kCyTE kqlrAlnZGiKZO+RgZV/eu7UXmZNtfXjEjohrMZf/saX1k2dOmRvvj/9AlGNdPVlcVooK 2vGgfZlaln/j6gLABfX0CycvFwzb54HUwzTJSvLgCCA8yHEjemSKZUxg6mHTHgYPeCUc imguewAEYE0PcLQ6cX9GbOFHLn2Kr6JpbGhAJcs+/tNo8O7agsDDjCEGTcrNnhR+VRe1 CTpg== 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 di13-20020a170906730d00b007ae5ccae236si8127885ejc.90.2023.01.08.19.45.36; Sun, 08 Jan 2023 19:46:03 -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 S231238AbjAIDl2 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 8 Jan 2023 22:41:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjAIDl1 (ORCPT ); Sun, 8 Jan 2023 22:41:27 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8133965B8; Sun, 8 Jan 2023 19:41:24 -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 0559324E1B2; Mon, 9 Jan 2023 11:41:15 +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 11:41:14 +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 11:41:14 +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 Date: Mon, 9 Jan 2023 03:41:14 +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 11:04 AM > 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 02:58:14AM +0000, JiaJie Ho wrote: > > > > My trng device requires sending a generate new number cmd before each > read. > > It then only populates the data registers with new random number and > raise an interrupt when ready. > > If user choose to not wait, they will always get stale bits. > > Is it okay to always return error if wait=false ? > > What is the length of the wait time? Is there an upper bound? > What is the average wait time? > The average wait time is around 20 microseconds. I measured from writel cmd to wait_for_completion done. Thanks Jia Jie