Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4210079ybh; Tue, 6 Aug 2019 08:02:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz41XW7qbBg8TWoOkhkHD5RHrb7uYkNfOdjA9ddl78PUXUnLs+aa6P0GP5JMNqMaVTIxyWp X-Received: by 2002:a65:6152:: with SMTP id o18mr2722098pgv.279.1565103740687; Tue, 06 Aug 2019 08:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565103740; cv=none; d=google.com; s=arc-20160816; b=N9hSGMq0huhJFSyrF8uyCDrlNLSlCXuSye2VVpEzj7C7N/WOqKwO/olIGF3Rpkx3r0 QpYTziCatTQ0lMhLz8fz75mJUJlQzy7U28yoXImJs1GSyRDeexMdzZPtCBfHWMPQoR17 oaGidrh3bJDQrJDcMeH3Cj4vgxupoSJFzWFLDyhfZpERf6SWGC3+lbkRjFtx96Q2r3oG EXEB2MVz1ghI6IY3BTB+ZT/pyj1Z0xxCYu2AkAFjxO1JG3O0lq1Nspqbub+B78hUyvTb w9bWKl5Fh3ySojRDSoGhpoJ67NuM+gIJeiN+eJ4UF3dtaVdmyfPYBKpoKZUhCbEOQFPK JZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=Eb02brmqmP+bKn8o/CtSlhtLL2DjYzWXI1dJoOmHVws=; b=inSVjSdd6SeutIbAM9h2sgyCgri+Vj6GeY0BL9Ihm5ALb3ZheLJEc80E8x4kuIyRXn +bqFYF+YDE5rsAv7KZLzYltG8pANBRksxR1VwXq9kPxezN7O9vVyJYLJzx0sPBpC7tWT 05MSZLOP5dag4T1TVK0J9NLrSlXd0eqFwFvp2+4QML+o2KYzx0hu4bXBPIAScA/HI4D7 O4yhvqAVhjn9RFa2KpHZheRIq2FU08hoeJNXjiAJE50nwmY0ewxgQdAbsBz/C1wktRdX qoyiwb4Mtkyg6BSjWD/2eQODMTbUKJx+a441ScQ6wAg3mTP5HklqE5K89HR1TjO949Qo ME5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SBHVFkT0; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y70si47732454pfg.184.2019.08.06.08.01.56; Tue, 06 Aug 2019 08:02:20 -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; dkim=pass header.i=@chromium.org header.s=google header.b=SBHVFkT0; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733114AbfHFPBD (ORCPT + 99 others); Tue, 6 Aug 2019 11:01:03 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35396 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732976AbfHFPBC (ORCPT ); Tue, 6 Aug 2019 11:01:02 -0400 Received: by mail-pg1-f196.google.com with SMTP id n4so7674pgv.2 for ; Tue, 06 Aug 2019 08:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=message-id:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:cc:to:user-agent:date; bh=Eb02brmqmP+bKn8o/CtSlhtLL2DjYzWXI1dJoOmHVws=; b=SBHVFkT04CnXj2BzqKjwe15XXW+whxMdICKRznLSFSSDLqu/XcqTiMcL3OlDamrzbi wrXD0KtHM3gbNfHtiHorbQ5EXVuXky4q/SuT1jGnUelEQECP0tNPHCuRwvIdol8jaCln ZLdL3bwpiool6mLFTfz5u4UHCWCPxVGbsYG60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version :content-transfer-encoding:in-reply-to:references:subject:from:cc:to :user-agent:date; bh=Eb02brmqmP+bKn8o/CtSlhtLL2DjYzWXI1dJoOmHVws=; b=MEuPk3mIgYPzD2QGHyd4bB+fqL3lso3iMueYrD1mEqMF3eAMCn0UY3/HFfGtf8TIkn P8EC5z2MPZ1/i6Sex3aIVlfMZtd/Ai1ULtUyKSlftpBuV3HCEhRbOmmHbxJ2xhk3ZxNH DFLut/RB8xTuQGCxsAkKr7eicRYh0o+ksQ9oZdqbIzXZxq9nHssjaXyvV//pIHaWOTb+ MQaeV7norh0n1pdw5WKd5hCykU9bP0fZdngiJySMJMY1AjrTTgpy/X345KgO7w6nJu7b ZfOOaQfgl1Fy2G88FG1dgEOW8unlhubpDowc0eY+JZ5h9mhUYLOKcHtUCxjGcfOBAzdg hJfQ== X-Gm-Message-State: APjAAAWyqdksZa6yOgaatsDbi4ijQy/0q2Sz9AtNCx+gCHuCmGX2BwUa UuQBOc7lFcl9Ze6sO1vRJPEkXw== X-Received: by 2002:a63:2004:: with SMTP id g4mr3265246pgg.97.1565103662068; Tue, 06 Aug 2019 08:01:02 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id o14sm18400492pjp.19.2019.08.06.08.01.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 08:01:01 -0700 (PDT) Message-ID: <5d49962d.1c69fb81.6e0a5.148a@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190805233241.220521-1-swboyd@chromium.org> References: <20190805233241.220521-1-swboyd@chromium.org> Subject: Re: [PATCH v3] hwrng: core: Freeze khwrng thread during suspend From: 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 To: Herbert Xu User-Agent: alot/0.8.1 Date: Tue, 06 Aug 2019 08:01:00 -0700 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Quoting Stephen Boyd (2019-08-05 16:32:41) > 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. >=20 > 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. >=20 > 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 > --- Sorry, forgot to add Fixes: be4000bc4644 ("hwrng: create filler thread")