From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9B4DC32750 for ; Fri, 2 Aug 2019 20:22:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BB08206A3 for ; Fri, 2 Aug 2019 20:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436953AbfHBUW1 (ORCPT ); Fri, 2 Aug 2019 16:22:27 -0400 Received: from mga06.intel.com ([134.134.136.31]:7287 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391221AbfHBUW0 (ORCPT ); Fri, 2 Aug 2019 16:22:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 13:22:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,339,1559545200"; d="scan'208";a="201783048" Received: from psathya-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.36.242]) by fmsmga002.fm.intel.com with ESMTP; 02 Aug 2019 13:22:10 -0700 Date: Fri, 2 Aug 2019 23:22:09 +0300 From: Jarkko Sakkinen To: Stephen Boyd Cc: Peter Huewe , linux-kernel@vger.kernel.org, Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , linux-integrity@vger.kernel.org, Andrey Pronin , Duncan Laurie , Guenter Roeck , Herbert Xu Subject: Re: [PATCH v2 1/6] hwrng: core: Freeze khwrng thread during suspend Message-ID: <20190802202209.2jzeosacc66mtnpr@linux.intel.com> References: <20190716224518.62556-1-swboyd@chromium.org> <20190716224518.62556-2-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190716224518.62556-2-swboyd@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2019 at 03:45:13PM -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: Herbert Xu > Cc: Duncan Laurie > Signed-off-by: Stephen Boyd This does not need a fixes tag? /Jarkko