From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49B6F4C97 for ; 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== Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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: 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