The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	linux-pm@vger.kernel.org, rjw@sisk.pl
Subject: Re: [PATCH] tpm: fix (ACPI S3) suspend regression
Date: Wed, 18 Jan 2012 09:19:46 -0200	[thread overview]
Message-ID: <20120118111946.GA3772@hardened-box.br.ibm.com> (raw)
In-Reply-To: <1326856050.32259.4.camel@d941e-10>

Thanks Stefan,

Acked-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>

On Tue, 17 Jan 2012, Stefan Berger wrote:

> This patch fixes an (ACPI S3) suspend regression introduced in commit
> 68d6e6713fcb2ea6278661aaaf5f1c9c821b3751 and occurring with an Infineon
> TPM and tpm_tis and tpm_infineon drivers active. Further, the suspend problem
> occurred if the TPM was disabled and/or deactivated and therefore the
> TPM_PCRRead checking the result of the (asynchronous) self test returned
> an error code which then caused the tpm_tis driver to become inactive and
> this then seemed to have negatively influenced the suspend support by the
> tpm_infineon driver...
> Besides that the tpm_tis drive may stay active even if the TPM is disabled
> and/or deactivated.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Tested-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> ---
>  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 for
> +			 * suspend/resume correctly
> +			 */
> +			return 0;
> +		}
>  		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 *);
> 
> 

-- 
Rajiv Andrade
Security Development
IBM Linux Technology Center


      reply	other threads:[~2012-01-18 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  3:07 [PATCH] tpm: fix (ACPI S3) suspend regression Stefan Berger
2012-01-18 11:19 ` Rajiv Andrade [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=20120118111946.GA3772@hardened-box.br.ibm.com \
    --to=srajiv@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --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