linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Peter Huewe <peterhuewe@gmx.de>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Andrey Pronin <apronin@chromium.org>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-integrity@vger.kernel.org, devicetree@vger.kernel.org,
	Duncan Laurie <dlaurie@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Matt Mackall <mpm@selenic.com>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH 1/8] tpm: block messages while suspended
Date: Tue, 16 Jul 2019 11:28:51 -0700	[thread overview]
Message-ID: <5d2e1764.1c69fb81.448bb.65c0@mx.google.com> (raw)
In-Reply-To: <20190624142654.zprcpz42hivuyrjq@gondor.apana.org.au>

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.


  reply	other threads:[~2019-07-16 18:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 18:09 [PATCH 0/8] tpm: Add driver for cr50 Stephen Boyd
2019-06-13 18:09 ` [PATCH 1/8] tpm: block messages while suspended Stephen Boyd
2019-06-13 23:26   ` Jason Gunthorpe
2019-06-14 18:12     ` Stephen Boyd
2019-06-17 22:51       ` Jason Gunthorpe
2019-06-21  1:03         ` Stephen Boyd
2019-06-24 14:26           ` Herbert Xu
2019-07-16 18:28             ` Stephen Boyd [this message]
2019-06-14 15:27   ` Jarkko Sakkinen
2019-06-14 18:13     ` Stephen Boyd
2019-06-17 16:38       ` Jarkko Sakkinen
2019-06-13 18:09 ` [PATCH 2/8] tpm_tis_core: add optional max xfer size check Stephen Boyd
2019-06-14 15:24   ` Jarkko Sakkinen
2019-06-13 18:09 ` [PATCH 3/8] tpm_tis_spi: add max xfer size Stephen Boyd
2019-06-14 15:25   ` Jarkko Sakkinen
2019-06-13 18:09 ` [PATCH 4/8] dt-bindings: tpm: document properties for cr50 Stephen Boyd
2019-07-09 14:41   ` Rob Herring
2019-06-13 18:09 ` [PATCH 5/8] tpm: add driver for cr50 on SPI Stephen Boyd
2019-06-13 18:09 ` [PATCH 6/8] tpm: Add driver for cr50 on I2C Stephen Boyd
2019-06-13 18:09 ` [PATCH 7/8] tpm: add sysfs attributes for tpm2 Stephen Boyd
2019-06-13 23:30   ` Jason Gunthorpe
2019-06-14 15:31   ` Jarkko Sakkinen
2019-06-13 18:09 ` [PATCH 8/8] tpm: add legacy " Stephen Boyd
2019-06-13 23:44   ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d2e1764.1c69fb81.448bb.65c0@mx.google.com \
    --to=swboyd@chromium.org \
    --cc=apronin@chromium.org \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dlaurie@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).