Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp320521ybc; Fri, 15 Nov 2019 23:33:12 -0800 (PST) X-Google-Smtp-Source: APXvYqz0DDAWnED+Xin9pJs9iYgP4zVi2AD+4JYNob3aCQ9vfZAYCX34MFQvEW25YXcdwBuIfqW9 X-Received: by 2002:a17:906:742:: with SMTP id z2mr7820993ejb.32.1573889592554; Fri, 15 Nov 2019 23:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573889592; cv=none; d=google.com; s=arc-20160816; b=tDlQSr2C3dmPDHgzsxmaK16qD2txVeXognfbnkEKrw7hpFJ6NyZd/iYHFe4M6GMwQD eAElY1sc/97jys6ZT2RBMLLr/06VMAgpQRkGVbGlmgNwQAzGaouYjKwXPrzjVy3qz/bX lb2FbtZIOsSFzDkwvFydDf0zpCXvWsBdNHzZHVwEZVkazXZ6snJwbcVA052k7SMSeSVN SsPzfDSpT9tBnLFT/3o/6SWSThRw7SZE1KRYg7s9re836W/sVDnScml3A+/091WXy/Ou arG2ZnXVvMW4R5TeBEfN5U00J+unzebctsk8WC9ClHRBhlaKXez6TqBrQL/LsdosJCjW Y+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LBRDrZqFbyiZ2m0ids+buUeO5HwhOErznJqxhzi+vYY=; b=QdEwQgYKG2ZBbdRp61ljowABFeEcW7qcgRutT3O6JY0F+GnBHcMHomg+4Ck3aimjwg 4Z4TdPPnaqGlVxsvapdrnaJKF5QNvF7yF4jNuPLmiz42kk2L4i+W+KuUB3Wa7GPlTbL2 DSWrnnXA12yoqHpALpZUmIJvn10QrtO1jT9uNYJeRhPYvFXzSSIeFB90BgV01EEZCo9n +OJXSRPy/43Zz5UdpJqN0wnfrcLfG4CNIXEY+bfUa2Qx0oFRklRR83c44Z+a3/CeXF6D N1xTqz352yqpkOziMfjxl0MU+CgDnsracRg6nphNogBOjPKbdR66kE/f9CBVkQqiBYcG 0t1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ur+Usnw3; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si8509905edf.32.2019.11.15.23.32.33; Fri, 15 Nov 2019 23:33:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ur+Usnw3; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbfKPHcc (ORCPT + 99 others); Sat, 16 Nov 2019 02:32:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:41242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbfKPHcc (ORCPT ); Sat, 16 Nov 2019 02:32:32 -0500 Received: from sol.localdomain (c-24-5-143-220.hsd1.ca.comcast.net [24.5.143.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 50C5B206D6; Sat, 16 Nov 2019 07:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573889551; bh=zvglgSWJ6QjYIekZR+EO9aF2ale+AA8m4tPCy7g+h3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ur+Usnw3CiHyZNjJgShg8J2UL/SY1m5HSqHhHC7GIOcUSF14nqYEAziVq6ciMunLI Y++NsJEqc7p5b3AWLjw5B7lQZRum/YjM8pCE/0uteVGYM2KiVUXCB6xG8afeKPHmFp Ls4y5LNtOcaLbiBlddsyOR4aWgp4KSRlHp/OzBbk= Date: Fri, 15 Nov 2019 23:32:29 -0800 From: Eric Biggers To: Herbert Xu Cc: "Sverdlin, Alexander (Nokia - DE/Ulm)" , "linux-crypto@vger.kernel.org" , Matt Mackall , Vitaly Andrianov Subject: Re: [PATCH] hwrng: ks-sa: Add minimum sleep time before ready-polling Message-ID: <20191116073229.GA161720@sol.localdomain> References: <20191106093019.117233-1-alexander.sverdlin@nokia.com> <20191115060610.2sjw7stopxr73jhn@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115060610.2sjw7stopxr73jhn@gondor.apana.org.au> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Nov 15, 2019 at 02:06:10PM +0800, Herbert Xu wrote: > On Wed, Nov 06, 2019 at 09:30:49AM +0000, Sverdlin, Alexander (Nokia - DE/Ulm) wrote: > > From: Alexander Sverdlin > > > > Current polling timeout is 25 us. The hardware is currently configured to > > harvest the entropy for 81920 us. This leads to timeouts even during > > blocking read (wait=1). > > > > Log snippet: > > [ 5.727589] [] (ks_sa_rng_probe) from [] (platform_drv_probe+0x58/0xb4) > > ... > > [ 5.727805] hwrng: no data available > > ... > > [ 13.157016] random: systemd: uninitialized urandom read (16 bytes read) > > [ 13.157033] systemd[1]: Initializing machine ID from random generator. > > ... > > [ 15.848770] random: fast init done > > ... > > [ 15.848807] random: crng init done > > > > After the patch: > > [ 6.223534] random: systemd: uninitialized urandom read (16 bytes read) > > [ 6.223551] systemd[1]: Initializing machine ID from random generator. > > ... > > [ 6.876075] random: fast init done > > ... > > [ 6.954200] random: systemd: uninitialized urandom read (16 bytes read) > > [ 6.955244] random: systemd: uninitialized urandom read (16 bytes read) > > ... > > [ 7.121948] random: crng init done > > > > Signed-off-by: Alexander Sverdlin > > --- > > drivers/char/hw_random/ks-sa-rng.c | 38 ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 38 insertions(+) > > Patch applied. Thanks. This is causing a build error. Seems that a line of the patch in ks_sa_rng_init() went missing when it was applied...? drivers/char/hw_random/ks-sa-rng.c: In function 'ks_sa_rng_init': drivers/char/hw_random/ks-sa-rng.c:146:47: error: 'clk_rate' undeclared (first use in this function) 146 | ks_sa_rng->refill_delay_ns = refill_delay_ns(clk_rate); | ^~~~~~~~ drivers/char/hw_random/ks-sa-rng.c:146:47: note: each undeclared identifier is reported only once for each function it appears in