[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5d2e1764.1c69fb81.448bb.65c0@mx.google.com>
Date: Tue, 16 Jul 2019 11:28:51 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Jason Gunthorpe <jgg@...pe.ca>, Peter Huewe <peterhuewe@....de>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Andrey Pronin <apronin@...omium.org>,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-integrity@...r.kernel.org, devicetree@...r.kernel.org,
Duncan Laurie <dlaurie@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
Matt Mackall <mpm@...enic.com>, linux-crypto@...r.kernel.org
Subject: Re: [PATCH 1/8] tpm: block messages while suspended
Quoting Herbert Xu (2019-06-24 07:26:54)
> On Thu, Jun 20, 2019 at 06:03:17PM -0700, Stephen Boyd wrote:
> >
> > What do you think of the attached patch? I haven't tested it, but it
> > would make sure that the kthread is frozen so that the hardware can be
> > resumed before the kthread is thawed and tries to go touch the hardware.
>
> Looks good to me.
>
Thanks for checking. I haven't been able to reproduce the problem yet to
confirm this is actually fixing anything, even after tweaking the sysctl
values for khwrng to try and force the thread to run continuously.
>From reading the bug report that caused this 'is_suspended' code to be
added to the driver I'm fairly convinced this is the right solution. To
give some more background, it looks like we use s2idle suspend (i.e.
all CPUs are idle across suspend) and then we have the kthread running
to ask the hardware for some more random numbers. The i2c transaction
fails when asking the hwrng for data, and we see these messages printed
on the resume path:
i2c_designware i2c_designware.2: i2c_dw_handle_tx_abort: lost arbitration
tpm tpm0: i2c transfer failed (attempt 3/3): -11
tpm0: tpm_transmit: tpm_send: error -11
hwrng: no data available
Userspace tasks are thawed after this failure so it looks like something
in the kernel kicks khwrng to grab more data before the i2c bus can be
resumed.
Powered by blists - more mailing lists