Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1103277rwr; Wed, 26 Apr 2023 10:05:33 -0700 (PDT) X-Google-Smtp-Source: AKy350b9Mk19ZGYyrP0j5y0tS+i1QMr6dyF/6nVa9gTYUIi+IaH4/Frt/NVhAJPd3Rcl6XFfkLh5 X-Received: by 2002:a17:902:ab58:b0:1a2:87a2:c910 with SMTP id ij24-20020a170902ab5800b001a287a2c910mr19631780plb.53.1682528733084; Wed, 26 Apr 2023 10:05:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682528733; cv=none; d=google.com; s=arc-20160816; b=W9v4oB/WvspQD6vC4cvnrmMjYvrFhl+zxEvOsor0JF1gIZVdACvGn3rai3YJfAqe3D HdQdVCw64GKONrJkNloeGAsXUbNx4gtqO2InhJFh8XNtkr7RegleqVyhaJH4plOCgz52 QHv7YEyi2R90HonU76CrJfvJo1nIlGPCEpGKKau5V5YC1FfE+VExFEDXjvovvVSIyAE8 hfvKuxuhc+N0yvHlNVoUGV2OwJqEZrIZ/ohgjzWu2FTD1dkPTCPxvFw2U2gUcpl+FqRI ouyCRn2aLobkix8JVJsIFcst3Gn2GiN6FW7u9ad23o/0Dd94SuNaBkuREbFOR4hbafeT drHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=uvfmM414+H1g4EvhGfa1Tdo1fBMxdLEOO3f/tMLT+8E=; b=vCPyZyj4kuTCLD4WVowU8CBCk4QhNFmzL9PeFUSPBZ6UhAAtmUBo+6z0eMoIScl7A6 MUrkkxw6B7yauDqnhlktdy+hDtL90VsOVFycQByNKRbjvMEEmYvDtLhFIEhvcIzQPP6n VrN3vOXIUWq1ehCSXUfFu5w181S23QRuT43QTj1KejNWO+vsS/gIjYqxob7Pyz/SKoTM P5cLjxUv0FBfCW8t93n/jr4WdeZYngNHM67u57prsBrZUc6KXl599YaSQAWEHjYGsUeZ 4wYJXoXeBva/CHp/0cHxOWxJFCNs1ZdOOHlQbbP3TAu7YCcz8Narf99jRGsLgw9MMNtV l3Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hNecQijV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv7-20020a17090b1b4700b00230a8355ff1si20697213pjb.181.2023.04.26.10.05.21; Wed, 26 Apr 2023 10:05:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hNecQijV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233617AbjDZRAW (ORCPT + 99 others); Wed, 26 Apr 2023 13:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232972AbjDZRAU (ORCPT ); Wed, 26 Apr 2023 13:00:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABA566181; Wed, 26 Apr 2023 10:00:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A6CA635FA; Wed, 26 Apr 2023 17:00:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEA04C433D2; Wed, 26 Apr 2023 17:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682528418; bh=MHqWRvkl5Cm+oF+SgyhqgDdM1Q4M/yDXHwZMMADe8N0=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=hNecQijVZZORG15ytwJCNNM5O9bn8FYhmGWYhiICBh2STfG07xDCjy46L6FysE1Bj WTaU/9GDnboVILfS0vvG0rmGoW67jP6T1Yr5GOwRD0mwbAWxW8/eFONzxAWRlu2P3r BbqJ0YrOsmuH5cNKOuQSYzQOUnVdhu08O+MMDJdLLPmB9KHvwMZXmCnvQ1FdTsl2Ri Z9G6NcIJ8ZTwVktb8NYdW6HKK4wEB+sLRqpCiknzbEVuiZVYpaDqOrsrV0quamwfLq DDUVLaCX0Zq+6bHnC8wTEzK6lYcv1KzxnUgNKCWtYzqKzovH/NNM7+8O4CnK2Vvi8s rKE54/gww4ImA== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 26 Apr 2023 20:00:14 +0300 Message-Id: Cc: "Thorsten Leemhuis" , "James Bottomley" , "Vlastimil Babka" , "Peter Huewe" , "Jason Gunthorpe" , "Jan Dabros" , , "LKML" , , "Dominik Brodowski" , "Herbert Xu" , "Linus Torvalds" , "Johannes Altmanninger" Subject: Re: [REGRESSION] suspend to ram fails in 6.2-rc1 due to tpm errors From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Jason A. Donenfeld" X-Mailer: aerc 0.14.0 References: <7ebab1ff-48f1-2737-f0d3-25c72666d041@leemhuis.info> <4268d0ac-278a-28e4-66d1-e0347f011f46@leemhuis.info> In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed Apr 26, 2023 at 7:07 PM EEST, Jarkko Sakkinen wrote: > On Wed Apr 26, 2023 at 4:32 AM EEST, Jason A. Donenfeld wrote: > > Nice work! Happy that you got it figured out. That trace seems > > consistent with what I was seeing in my traces, so I think you've > > spotted the right bug. > > > > Jason > > Unfortunately there might be two bugs. Unless I interpreted logs > incorrectly also hwrng can race with resume (sorry, I forgot to > save it). > > Looking at drivers/char/hw_random/core.c there seems to be no > binding to the PM so I guess that this it supports what I'm > observing [*]. > > So there's two ways to fix the issue: > > 1. Unregister hwrng for the course of suspend > 2. Add something like TPM_CHIP_SUSPENDED, which is set by suspend and > cleared by the resume. > > I try the 2nd option first because I see it less complicated. > Probably would make sense to turn chip flags as atomic while > at it. > > [*] https://elixir.bootlin.com/linux/latest/source/drivers/char/hw_random= /core.c OK, so I implemented fix also for hwrng and now I get a clean resume. I'll add all necessary tags etc. and send for review. BR, Jarkko