All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Daniel Drake <drake@endlessm.com>
Cc: chiu@endlessm.com, linux@endlessm.com, peterhuewe@gmx.de,
	jgg@ziepe.ca, linux-integrity@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: TPM driver breaks S3 suspend
Date: Fri, 16 Mar 2018 15:44:17 +0200	[thread overview]
Message-ID: <20180316134417.GB7387@linux.intel.com> (raw)
In-Reply-To: <20180315101119.30222-1-drake@endlessm.com>

On Thu, Mar 15, 2018 at 06:11:19PM +0800, Daniel Drake wrote:
> Hi,
> 
> Sorry for the delayed response.
> 
> Unfortunately we had to return the affected machine to the vendor
> (Acer Veriton X4110G) although given we have a fairly complete
> understanding of the problem, perhaps we can find and push a fix
> anyway.
> 
> Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> wrote:
> > Can you try it on git://git.infradead.org/users/jjs/linux-tpmdd.git ?
> > Maybe it is related to the LPC #CLKRUN issues we've had.
> 
> I don't see anything relevant in that git tree, and it seems like
> a distant issue from the CLKRUN changes that have been made.
> 
> To recap, the first suspend works OK, and then the TPM shows shows the
> following message on the first resume:
>   tpm tpm0: A TPM error(38) occured continue selftest
> And error(38) is TPM_ERR_INVALID_POSTINIT which means the TPM is
> not in the correct state. Then the following suspend will always
> fail with the following messages.
>   tpm tpm0: Error (38) sending savestate before suspend
>   PM: Device 00:0b failed to suspend: error 38
> 
> tpm_crb is the driver here (not tpm2).
> 
> This exact problem was also discussed in depth years ago at
> https://lists.gt.net/linux/kernel/1358716
> 
> The patch that we used to avoid the issue is below. What do you think?

I think this would work for me.

/Jarkko

> 
> Thanks
> Daniel
> 
> 
> ---
>  drivers/char/tpm/tpm-interface.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 1d6729be4cd6..444ae2df4a06 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -953,6 +953,10 @@ int tpm_do_selftest(struct tpm_chip *chip)
>  	loops = jiffies_to_msecs(duration) / delay_msec;
>  
>  	rc = tpm_continue_selftest(chip);
> +	if (rc == TPM_ERR_INVALID_POSTINIT) {
> +		chip->flags |= TPM_CHIP_FLAG_ALWAYS_POWERED;
> +		dev_info(&chip->dev, "TPM not ready (%d)\n", rc);
> +	}
>  	/* This may fail if there was no TPM driver during a suspend/resume
>  	 * cycle; some may return 10 (BAD_ORDINAL), others 28 (FAILEDSELFTEST)
>  	 */
> -- 
> 2.14.1
> 

      reply	other threads:[~2018-03-16 13:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  8:04 TPM driver breaks S3 suspend Chris Chiu
2017-12-21  9:22 ` Paul Menzel
2017-12-21  9:22   ` Paul Menzel
2017-12-21  9:43   ` Chris Chiu
2017-12-24 20:35     ` Jarkko Sakkinen
2017-12-21 10:19 ` Alexander.Steffen
2017-12-21 16:17   ` Jason Gunthorpe
2017-12-22  2:05   ` Chris Chiu
2017-12-22 13:34     ` Alexander.Steffen
2017-12-22 19:32   ` Ken Goldman
2017-12-24 20:37   ` Jarkko Sakkinen
2017-12-24 20:33 ` Jarkko Sakkinen
2017-12-25  2:43   ` Chris Chiu
2018-01-02 14:43     ` Jarkko Sakkinen
2018-03-15 10:11       ` Daniel Drake
2018-03-16 13:44         ` Jarkko Sakkinen [this message]

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=20180316134417.GB7387@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=chiu@endlessm.com \
    --cc=drake@endlessm.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.