Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1108787ybi; Wed, 17 Jul 2019 09:38:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgTFkMX5knyrvqjsUYWtawH5lHnx6zAkJkim68k98mQ6rjfLQZYoQalZaddeiJ8RpqjJYs X-Received: by 2002:a17:90a:d14b:: with SMTP id t11mr45192862pjw.79.1563381518637; Wed, 17 Jul 2019 09:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563381518; cv=none; d=google.com; s=arc-20160816; b=QRdSee8IQn6xlAh4D/ITU0yOGAvkfXGZBFyIoVT0idvqlCKLoNWKXEDV7rAsv+kONX IomwS6et5VYtKZDeGAvoaatZR8QA+M09fpneXbxdgt4RuBHpMRLF5oNGbMmo45iGYLd8 wqyo6USVX0mo197XHgcJ7WJpRXLmaWnk60RaHpvONpxuISNTQbJxiVEsFPo6LeyGlG1z EDdfuy645t3B6Y0XP7bYAS/W9NFcWFygWbCeZ8Z8XGH1rMMc9JH0JcGUk4d/ErUf4jq8 6uqe54MVVsebTAXEziffik7x/Klbr8RjyNSy7bbtIqGhg9GRxV5JxW6e3N/w8nFXbIbm Ng2Q== 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:from:cc:to:subject :references:in-reply-to:content-transfer-encoding:mime-version :message-id:dkim-signature; bh=N0IoPmcNnKM1kJS4mNJCWU46BnLTmxMTIU2UXP3rmdY=; b=OyghBo+1EH+DFDrA8GainYOAdax2u5/hlGLQgUaIIdgtjYg6Y7pJO1eeML4X/GR21v bev/nqYzldSoAqKWlOZvhz7L2Jm9H++3vSgGWsIoQ68fxrj/DT1Yk1ekPsObnS+IXIyZ pwLxhG8YZmHjgVFWS9npUC6JrdnO53HO/7Gie58AhXnCUO+ulwSc80Nlr1LY21mMZW0V QwvDpNnwISHjnOHpExdzJgrbmJnPZLLdj3tvQEGR/98+OWq08YXs9pKUWBA5ZKq8MT6o 51BBC3+ayuEA/tjponUG7ae5w4P3StnOX5eYXTFl3OeQT6VMs5u/AMZOby4GKncRIsce ZqVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="gGwLB/cq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r185si23241651pgr.506.2019.07.17.09.38.22; Wed, 17 Jul 2019 09:38:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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="gGwLB/cq"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726494AbfGQQgP (ORCPT + 99 others); Wed, 17 Jul 2019 12:36:15 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46310 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfGQQgP (ORCPT ); Wed, 17 Jul 2019 12:36:15 -0400 Received: by mail-pg1-f196.google.com with SMTP id i8so11402824pgm.13 for ; Wed, 17 Jul 2019 09:36:15 -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:to:cc:from:user-agent:date; bh=N0IoPmcNnKM1kJS4mNJCWU46BnLTmxMTIU2UXP3rmdY=; b=gGwLB/cqZp7GUACZiJefpZ+436oxp6o5vUK/UHpTJEZ5ybBSbWRkxVyrBlO51X/pRO Y0GIwnOit9Apb0qPbP6NQUg6vB075BQmAQGmJnuCtgd4AnW6yh/gM7ZXu1xosrCcpCDx OYwQPO5XWGEmJndS2NTvsC9uByZIT26cMlTxg= 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:to:cc:from :user-agent:date; bh=N0IoPmcNnKM1kJS4mNJCWU46BnLTmxMTIU2UXP3rmdY=; b=djldbw83cJhYfK6gk1hix1EsWIxDIEdiebzw7ZbME3ujRXGG5aHBRRDhUF+ClWXulw WoQde/FjcvR6kR171GWIK2/gSWY8TUyXz14s4R8DKxPehjR7GI27YuhVFqQT0GhkWUIW J/WSX82xLAtFti1qZyexuDAq/IAO6nNMTGBaaB4P32LFLsX3tHDZaqqTsrkzs4o28Zy2 U20ET3fNWySJGz+v7/UVezRiepWh2Ek5qcse5DRbr9T19N0Pv6ApCQL/VJ/sqnu6dlVf 7z5xJWHo+rvjMS5pOmXR5vDPSH4sOGlb/hEn4oHoRD5Lx4FWNHBYPpax0RAJs8sUA1yV AbaA== X-Gm-Message-State: APjAAAWqnox/aN5m5rGcDjj8ZSfh5+kc29T6ir8auS8Ow2Fm6gKRD7mU V6BItMM9tWaQt6jEWhjLhRpfeQ== X-Received: by 2002:a65:690f:: with SMTP id s15mr37742190pgq.432.1563381374496; Wed, 17 Jul 2019 09:36:14 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id b30sm36977484pfr.117.2019.07.17.09.36.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 09:36:14 -0700 (PDT) Message-ID: <5d2f4e7e.1c69fb81.a9a8c.a3d2@mx.google.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190717014359.5xcnubpmazl3vqg5@gondor.apana.org.au> References: <20190716224518.62556-1-swboyd@chromium.org> <20190716224518.62556-2-swboyd@chromium.org> <20190717014359.5xcnubpmazl3vqg5@gondor.apana.org.au> Subject: Re: [PATCH v2 1/6] hwrng: core: Freeze khwrng thread during suspend To: Herbert Xu Cc: Peter Huewe , Jarkko Sakkinen , linux-kernel@vger.kernel.org, Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , linux-integrity@vger.kernel.org, Andrey Pronin , Duncan Laurie , Guenter Roeck From: Stephen Boyd User-Agent: alot/0.8.1 Date: Wed, 17 Jul 2019 09:36:13 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Herbert Xu (2019-07-16 18:43:59) > 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. > >=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: Herbert Xu > > Cc: Duncan Laurie > > Signed-off-by: Stephen Boyd > > --- > > drivers/char/hw_random/core.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > Do you want this to go through the crypto tree? If so you need > to cc the linux-crypto mailing list. >=20 Sure. I'll resend just this one Cced to the linux-crypto list and to you.