Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1033228rwr; Wed, 26 Apr 2023 09:17:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YzkBxTCyTlHlcmuKSz92Rh+3deDSqtWLMZqC/4nwF6tf2HW0vCMqHG9qkbwglCPB8G8RKd X-Received: by 2002:a17:902:ecc4:b0:1a9:51bd:50ac with SMTP id a4-20020a170902ecc400b001a951bd50acmr22969955plh.20.1682525843036; Wed, 26 Apr 2023 09:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682525843; cv=none; d=google.com; s=arc-20160816; b=hEVw3toZz2FDtRkS7jHUWUrkG/3jrcKq+JBIecb5Ppf6qtiW+otJay2PJn5ZlMwcO4 2mSQt76b2nYj/QqQ9ti86Ue6oeXS+x6t0Vanqjhjhizlk5pXMSQEsaQlCT0HCkG/MoWb cMuIGNGl1ypi7ztOrf5Uab36rz1avPtcW85tlN1VJCVm3yEOblDPvmR3NDXL00YKPuau tUpJtfw/oYurZGx7om4L0nprO98goC5sOIdtEkmMYzmNOcy2HJlECjkkIvg1FS2vXBy4 Yvbq925AcQezf9VsU7i/dtVOFJ98h0mXbQ9LZ7LE37kgUlKNbr2LW0SZFqukS2CztCOE B0iA== 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:subject:cc:to:from :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=G5t4/2iBLE81g92Hp0vcsY/tcp1ZkYCjc4jb4aoFyd0=; b=cPG3rbZmcppb42bNTzCqOVPO+G1YT578mPNXjh/RdRNY08Y04SVpqej6xGD1acDBMr QyN7K6LNW22hY5IwHLZb2hg1qWdVsgQ9F1SRdtKtKc1TjwfCmI0KxVDR6SRMs7O4Sy4W wdWy7MAp1lPWnNKk0RgYRsXUv+/5B6Q5eO6cewFlmSV9ZzFWkoqtXR+CS5zhS8ZiWgEu DIte76W1v01TszpKzTpQsENeyNPGy+EoMg5znpYKiFdPDm5oQkj8wqkalP8/qucWj3Rc 2WQcCSAKRfkMLAq9gQLzc/F4otQupEWKt75IjIgL2EkyoW7iqDKm9yEX3oabtuKMAM2V uRiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H7r9VsvZ; 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 s6-20020a17090a948600b0023b4158aaf1si16672669pjo.62.2023.04.26.09.17.09; Wed, 26 Apr 2023 09:17:23 -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=H7r9VsvZ; 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 S241312AbjDZQHJ (ORCPT + 99 others); Wed, 26 Apr 2023 12:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232584AbjDZQHH (ORCPT ); Wed, 26 Apr 2023 12:07:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1E24EF3; Wed, 26 Apr 2023 09:07:07 -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 9AD0B60C58; Wed, 26 Apr 2023 16:07:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67E3AC4339B; Wed, 26 Apr 2023 16:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682525226; bh=MtdltU0gId4xiQS9pBYRsib3cwgvWJxO+NqnGQqu2vM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H7r9VsvZreCFlc+MHRmUOvuUsDXVcks2Q/e7B+wnn+0tuHK2O7dPNtfFcFbyB8Msk 2rib2E5XuVZ0n3ZXHisfJQkJi8nmvPJegXx73MK1ufwAZ6SAN/pHGjfbCsWvpIU0VZ rzfHi41OPYzHwp2PmEP1fRLSBx4ep0vb9JNH4q1mNED4vk7zXWxPSFwrq52NZvvK4J LeP9O5Ckh+8Zo6Ajhy/B5FetnjHkDCPLeErRXKkeR8Vjsql55S/WEq43MHiBBH8oIU M1nhck9oIfacvQfZiY2CNV9PvCZUXMaCFina+WZK7N/NDSDDrNAd2egH5CFvElGdti edn8Fqk6KiQvg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 26 Apr 2023 19:07:01 +0300 Message-Id: From: "Jarkko Sakkinen" To: "Jason A. Donenfeld" 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 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=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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/c= ore.c BR, Jarkko