[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <CS6UJMSTVA4L.FRQ5VL1I1EF4@suppilovahvero>
Date: Wed, 26 Apr 2023 20:00:14 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Jarkko Sakkinen" <jarkko@...nel.org>,
"Jason A. Donenfeld" <Jason@...c4.com>
Cc: "Thorsten Leemhuis" <regressions@...mhuis.info>,
"James Bottomley" <James.Bottomley@...senpartnership.com>,
"Vlastimil Babka" <vbabka@...e.cz>,
"Peter Huewe" <peterhuewe@....de>,
"Jason Gunthorpe" <jgg@...pe.ca>, "Jan Dabros" <jsd@...ihalf.com>,
<regressions@...ts.linux.dev>,
"LKML" <linux-kernel@...r.kernel.org>,
<linux-integrity@...r.kernel.org>,
"Dominik Brodowski" <linux@...inikbrodowski.net>,
"Herbert Xu" <herbert@...dor.apana.org.au>,
"Linus Torvalds" <torvalds@...ux-foundation.org>,
"Johannes Altmanninger" <aclopte@...il.com>
Subject: Re: [REGRESSION] suspend to ram fails in 6.2-rc1 due to tpm errors
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
Powered by blists - more mailing lists