mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Subject: Re: [Regression] Commit "tpm: Introduce function to poll for result of self test" breaks suspend
Date: Tue, 17 Jan 2012 23:13:55 +0100	[thread overview]
Message-ID: <201201172313.55950.rjw@sisk.pl> (raw)
In-Reply-To: <4F14B7AC.9090708@linux.vnet.ibm.com>

On Tuesday, January 17, 2012, Stefan Berger wrote:
> On 01/16/2012 05:50 PM, Rafael J. Wysocki wrote:
> > On Monday, January 16, 2012, Stefan Berger wrote:
> >> On 01/16/2012 05:05 PM, Rafael J. Wysocki wrote:
> > Yes, there are.  Below is the result of grepping tpm in dmesg output (the
> > entire dmesg log from that box is attached).
> >
> > [    5.066807] tpm_tis 00:0a: 1.2 TPM (device-id 0xB, rev-id 16)
> > [    7.167236] tpm_tis 00:0a: Adjusting TPM timeout parameters.
> > [    7.893190] tpm_tis 00:0a: A TPM error (7) occurred attempting to read a pcr value
> > [    7.897202] tpm_tis 00:0a: TPM self test failed
> > [    7.907599] tpm_inf_pnp 00:0a: Found TPM with ID IFX0102
> > [    7.909745] tpm_inf_pnp 00:0a: TPM found: config base 0x4e, data base 0x680, chip version 0x000b, vendor id 0x15d1 (Infineon), product id 0x000b (SLB 9635 TT 1.2)
> > [   96.386200] tpm_inf_pnp 00:0a: saving TPM state
> > [   96.407630] tpm_inf_pnp 00:0a: Timeout while clearing FIFO
> > [   96.407634] tpm_inf_pnp 00:0a: error while saving TPM state
> >
> > Thanks,
> > Rafael
> If possible, I'd like the patch to stick a little longer. Can you try 
> the following and tell me whether this solves the problem with the 
> suspend/resume.

Yes, the patch below helps.

Thanks,
Rafael


> This patch handles the error codes reading of a PCR may cause when a TPM 
> is disabled and/or deactivated. They would not be a reason for the 
> tpm_do_selftest function to fail.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> 
> ---
>   drivers/char/tpm/tpm.c |    9 +++++++++
>   drivers/char/tpm/tpm.h |    3 +++
>   2 files changed, 12 insertions(+)
> 
> Index: linux-2.6/drivers/char/tpm/tpm.c
> ===================================================================
> --- linux-2.6.orig/drivers/char/tpm/tpm.c
> +++ linux-2.6/drivers/char/tpm/tpm.c
> @@ -846,6 +846,15 @@ int tpm_do_selftest(struct tpm_chip *chi
> 
>       do {
>           rc = __tpm_pcr_read(chip, 0, digest);
> +        if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) {
> +            dev_info(chip->dev,
> +                 "TPM is disabled/deactivated (0x%X)\n", rc);
> +            /* TPM is disabled and/or deactivated; driver can proceed
> +             * and TPM does handle commands during suspend/resume
> +             */
> +            rc = 0;
> +            break;
> +        }
>           if (rc != TPM_WARN_DOING_SELFTEST)
>               return rc;
>           msleep(delay_msec);
> Index: linux-2.6/drivers/char/tpm/tpm.h
> ===================================================================
> --- linux-2.6.orig/drivers/char/tpm/tpm.h
> +++ linux-2.6/drivers/char/tpm/tpm.h
> @@ -39,6 +39,9 @@ enum tpm_addr {
>   };
> 
>   #define TPM_WARN_DOING_SELFTEST 0x802
> +#define TPM_ERR_DEACTIVATED     0x6
> +#define TPM_ERR_DISABLED        0x7
> +
>   #define TPM_HEADER_SIZE        10
>   extern ssize_t tpm_show_pubek(struct device *, struct device_attribute 
> *attr,
>                   char *);

      reply	other threads:[~2012-01-17 22:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 23:22 Rafael J. Wysocki
2012-01-16  2:27 ` Stefan Berger
2012-01-16 20:42   ` Rafael J. Wysocki
2012-01-16 21:15     ` Stefan Berger
2012-01-16 22:05       ` Rafael J. Wysocki
2012-01-16 22:43         ` Stefan Berger
2012-01-16 22:50           ` Rafael J. Wysocki
2012-01-16 23:50             ` Stefan Berger
2012-01-17 22:13               ` Rafael J. Wysocki [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=201201172313.55950.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srajiv@linux.vnet.ibm.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /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

Powered by JetHome