From: PrasannaKumar Muralidharan Subject: Re: [PATCH] hwrng: do not warn when there are no devices Date: Fri, 12 May 2017 12:22:02 +0530 Message-ID: References: <20170512041734.31945-1-vapier@gentoo.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Mike Frysinger , Matt Mackall , Herbert Xu , linux-crypto@vger.kernel.org To: Mike Frysinger Return-path: Received: from mail-ua0-f195.google.com ([209.85.217.195]:34382 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753775AbdELGwD (ORCPT ); Fri, 12 May 2017 02:52:03 -0400 Received: by mail-ua0-f195.google.com with SMTP id j17so5046679uag.1 for ; Thu, 11 May 2017 23:52:03 -0700 (PDT) In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: On 12 May 2017 at 12:11, Mike Frysinger wrote: > On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: >> On 12 May 2017 at 09:47, Mike Frysinger wrote: >> > From: Mike Frysinger >> > >> > If you build in hwrng & tpm-rng, but boot on a system that doesn't >> > have a tpm (like via KVM), hwrng will spam the logs every 10 seconds >> > with the line: >> > hwrng: no data available >> > >> > This isn't terribly useful, so squelch the error in the ENODEV case. >> > For all other errors, we still warn, and include the actual error. If the boot system does not have a tpm I think registering tpm-rng is not useful. On tpm-rng load instead of registering with hwrng a check can be made whether the system supports tpm. Is this possible? >> This patch removes the logging but does not fix the real problem. >> Better method would be to start the hwrng_fillfn thread when first rng >> provider registers and stop it when the last rng provider unregisters. > > what you describe is already implemented in the hw random code. the > kthread only starts up when a registration happens, and will stop it > when the last rng unregisters itself. > > the issue is that tpm-rng has registered itself here, but there aren't > any tpm devices available. so it returns ENODEV. Missed it. Please see if the above comment can be addressed. Thanks, PrasannaKumar