Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2022336ybl; Thu, 15 Aug 2019 05:19:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBAtKV3L3wVmp5c3Dqgfc01TV5oXCcMhMM0A8ySR8Dgutn9fXOXaTmOCuCzNAwUxTKtzeP X-Received: by 2002:a17:902:ac88:: with SMTP id h8mr3750566plr.77.1565871578370; Thu, 15 Aug 2019 05:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565871578; cv=none; d=google.com; s=arc-20160816; b=uY6ygQHYFAputjZ2n8e+ikGpVCTimvauKrG3StObEqJsTV5gO2rz0JqbqvlRiNemll Pf2BQZ/qpknD9goXQSZkP/BMOLPRnbLuEMSNIgS3jVZBqmMFVvvHBalVE5WpPfLsDJni NDIylQ14uSh7l4oCaAhsGEe5Ha/3F2MiVIKCi9L9jZjDpg6/EYJzoEdPq4SNkphXQx8h GhppV/6JcI/Y+5n2CMaQYMZtrU8AP335KYsv8vekRiiY2TaH9IF7D1tcOIiJ5ad6AfWR 6tKBBi85hOh95JAT8mZi+kjb6/UFLnx2/OTGmqKltvvUpMkCk8/72B1hCGnH4tJZkSfU KYyw== 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; bh=IpcV/cc1X+8XJCeC8t294AVNYq06yhPHTNfHfCOPSvI=; b=e2jvC+m1OHsrm/C7F25QrTHZuRMQJTWnznJU3tIUazHKs4I6NZqw8Xghao7GpKt0S5 qdAgznk+u5fJbSxxMx5QNSdui9mk9K931YQYslk9f9b7/7ndrv1/zBE7CKlV/d3v4CRc BxQ+Uqi56DmxtdVDJobLf79Sh5uLrbe5qusN/Qga7JP6sFiGy5TSHrw0WR4d2XhxOoi1 tNB2t7csk1lu89gBZZB7Ni0/d8jTq1ebfoQcr7I5Om2o4Lcw/LOhY5CjW3witEWNhaYr Y6fISYMaeO2kEjk3SKJ8O9F9HvyjbOrr6FNtAEHfrBxWsceTjnb/vCiEj/zPwJlH6kN6 zsiw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si905730pjf.45.2019.08.15.05.19.24; Thu, 15 Aug 2019 05:19:38 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730601AbfHOMGP (ORCPT + 99 others); Thu, 15 Aug 2019 08:06:15 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:57196 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730596AbfHOMGP (ORCPT ); Thu, 15 Aug 2019 08:06:15 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6] helo=gondolin.hengli.com.au) by fornost.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hyEWB-0003Jx-R1; Thu, 15 Aug 2019 22:06:11 +1000 Received: from herbert by gondolin.hengli.com.au with local (Exim 4.80) (envelope-from ) id 1hyEW7-0007e5-41; Thu, 15 Aug 2019 22:06:07 +1000 Date: Thu, 15 Aug 2019 22:06:07 +1000 From: Herbert Xu To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Andrey Pronin , Duncan Laurie , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , Guenter Roeck , Alexander Steffen Subject: Re: [PATCH v3] hwrng: core: Freeze khwrng thread during suspend Message-ID: <20190815120607.GB29355@gondor.apana.org.au> References: <20190805233241.220521-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805233241.220521-1-swboyd@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Aug 05, 2019 at 04:32:41PM -0700, Stephen Boyd wrote: > The hwrng_fill() function can run while devices are suspending and > resuming. If the hwrng is behind a bus such as i2c or SPI and that bus > is suspended, the hwrng may hang the bus while attempting to add some > randomness. It's been observed on ChromeOS devices with suspend-to-idle > (s2idle) and an i2c based hwrng that this kthread may run and ask the > hwrng device for randomness before the i2c bus has been resumed. > > Let's make this kthread freezable so that we don't try to touch the > hwrng during suspend/resume. This ensures that we can't cause the hwrng > backing driver to get into a bad state because the device is guaranteed > to be resumed before the hwrng kthread is thawed. > > Cc: Andrey Pronin > Cc: Duncan Laurie > Cc: Jason Gunthorpe > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Cc: Guenter Roeck > Cc: Alexander Steffen > Signed-off-by: Stephen Boyd > --- > > I'm splitting this patch off of the larger series so it can > go through the crypto tree. See [1] for the prevoius round. > Nothing has changed in this patch since then. > > [1] https://lkml.kernel.org/r/20190716224518.62556-2-swboyd@chromium.org > > drivers/char/hw_random/core.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt