[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tpmdd-devel
Subject:    Re: [tpmdd-devel] tpm_tis hangs boot for 2min when built-in in
From:       Stefan Berger <stefanb () linux ! vnet ! ibm ! com>
Date:       2011-12-20 22:59:21
Message-ID: 4EF11349.5070703 () linux ! vnet ! ibm ! com
[Download RAW message or body]

On 12/20/2011 03:08 PM, Josh Boyer wrote:
> Hi Rajiv and Stefan,
>
> We have had a couple bug reports where users are trying to boot their
> machines with 3.1.x (3.1.5 currently) and they see a 2min hang during
> boot.  I've isolated it down to the tpm_tis driver looping while waiting
> for data from the TPM on these machines (Thinkpad 510).  The tpm modules
> are built-in because IMA is set on this particular vintage of the Fedora
> kernel.
>
> When users add tpm_tis.itpm=1 to the kernel command line, the boot does
> not hang at all and proceeds normally.  In 3.1, a commit was added to
> probe for the iTPM (9519de3f265f1) if the itpm parameter isn't set or if
> ACPI presents an iTPM.  This seems to have caused the pause.
>
> I'm not sure why the probe function does a full 2min timeout on this
> class of machine.  Do you have any ideas, or other things that can be
> done to debug.  Also, aside from passing tpm_tis.itpm=1, is there
> another way to avoid probing for a TPM on a certain class of machine?  A
> blacklist perhaps?

As it turned out the problem is only occurring with ST Micro TPMs that 
need an additional timeout after the probing. The Thinkpad 510 seems to 
have such a device. I had tested the code with 3 other TPMs (from other 
manufacturers) of which none needed that timeout. Would either one of 
the users experiencing the hang be willing to apply this patch and give 
it a try and let us know whether the problem indeed went away? Thanks a 
lot in advance :-)

This patch adds a delay after aborting a command. Some TPMs need
this and will not process the subsequent command correctly otherwise.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

---
  drivers/char/tpm/tpm_tis.c |    3 +++
  1 file changed, 3 insertions(+)

Index: linux-2.6/drivers/char/tpm/tpm_tis.c
===================================================================
--- linux-2.6.orig/drivers/char/tpm/tpm_tis.c
+++ linux-2.6/drivers/char/tpm/tpm_tis.c
@@ -432,6 +432,9 @@ static int probe_itpm(struct tpm_chip *c
  out:
      itpm = rem_itpm;
      tpm_tis_ready(chip);
+    /* some TPMs need a break here otherwise they will not work
+     * correctly on the immediately subsequent command */
+    msleep(chip->vendor.timeout_b);
      release_locality(chip, chip->vendor.locality, 0);

      return rc;



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic