Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5660223rwl; Sun, 8 Jan 2023 20:07:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXukQwtInbp2Farbjrwg7C3ig7JbA3/0QOON8TARfUftOlRqDUhyzX//gkx72Wt+bZ4cH7pO X-Received: by 2002:a05:6a20:4643:b0:af:f3a8:82fd with SMTP id eb3-20020a056a20464300b000aff3a882fdmr60780566pzb.48.1673237241847; Sun, 08 Jan 2023 20:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673237241; cv=none; d=google.com; s=arc-20160816; b=Mu/5jZLSXpVBJbVcLAJklVr+LWh9nbH7ctk0PXWUpxrorWgkgxa0n8LzJp+BC6rwyP gOF++VqWS/IUf4aLq7tBfwpR1aD41n9Fv4+KLjnTKf3vWJG2qe2oLDxWPbSBvIhxm7Lm U0pOlStujL8nAfoa58uDZj3hLLXTzj6GlhHL8ctdoNiO2R6dm63bNb5mMgGIt6kpv0lC 553iNVARLki6iODtUMjSCIQ2h4i8NFBryqpb7/FJMgY3kweYOpFpYwCphKM4LgNHZ1nD raD4pO2vAQp4iSkpAwoeD/0fR54TDmbzVIxjoDbRqscsq5o163v7jmXLbdTo+Vfrmjxg zRxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jXX5d6cJ3Jj/Vz3QwQ+IszWEh6MH2NUCnpepj9ihEo0=; b=W+uipxIvvrLYRQU7BZ67LpgJZqaoELZWogw37bknAdNad6gF2bguoyDbFmDpzF55lV BQIDnDgw8Ze65QUQFDyzJHPYt2WdZ5u7UVFhE0cAbfIz3HZuIaSx7r0DNUZjnU4N6+Db f1dElSLLOwNSyiEyPSpe+1QCU9wjD21Xv5TT54e5AZ/wo8PUIdeZJEtAqVE5QREkFpj9 l0sftPTcWP7u6kfPkv49yXPLIWGrHk0Gu0sfC3Z41xgaKYg3mx6GkUkzBaC+g09EH4w4 JV0sBeGNDxyKNV3xF999FuVgb9mwGbdBd3awetMXwJH86r3xMcTcEd5bU0dQa3GpIyXV 2TBQ== 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 u9-20020a637909000000b0047caad28cdbsi8728319pgc.621.2023.01.08.20.07.04; Sun, 08 Jan 2023 20:07:21 -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 S234198AbjAIEAr (ORCPT + 99 others); Sun, 8 Jan 2023 23:00:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233961AbjAIEAo (ORCPT ); Sun, 8 Jan 2023 23:00:44 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664C76450; Sun, 8 Jan 2023 20:00:40 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pEjKe-00FRxO-1i; Mon, 09 Jan 2023 12:00:21 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Mon, 09 Jan 2023 12:00:20 +0800 Date: Mon, 9 Jan 2023 12:00:20 +0800 From: Herbert Xu 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 Message-ID: References: <20221228071103.91797-1-jiajie.ho@starfivetech.com> <20221228071103.91797-3-jiajie.ho@starfivetech.com> <7c2cc6e9cdf241318fc73162a5ec221d@EXMBX168.cuchost.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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 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? 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. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt