<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/char/tpm, branch v3.10</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>TPM: Retry SaveState command in suspend path</title>
<updated>2013-04-17T14:31:32+00:00</updated>
<author>
<name>Duncan Laurie</name>
<email>dlaurie@chromium.org</email>
</author>
<published>2013-03-17T21:56:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=32d33b29ba077d6b45de35f2181e0a7411b162f4'/>
<id>32d33b29ba077d6b45de35f2181e0a7411b162f4</id>
<content type='text'>
If the TPM has already been sent a SaveState command before the driver
is loaded it may have problems sending that same command again later.

This issue is seen with the Chromebook Pixel due to a firmware bug in
the legacy mode boot path which is sending the SaveState command
before booting the kernel.  More information is available at
http://crbug.com/203524

This change introduces a retry of the SaveState command in the suspend
path in order to work around this issue.  A future firmware update
should fix this but this is also a trivial workaround in the driver
that has no effect on systems that do not show this problem.

When this does happen the TPM responds with a non-fatal TPM_RETRY code
that is defined in the specification:

  The TPM is too busy to respond to the command immediately, but the
  command could be resubmitted at a later time.  The TPM MAY return
  TPM_RETRY for any command at any time.

It can take several seconds before the TPM will respond again.  I
measured a typical time between 3 and 4 seconds and the timeout is set
at a safe 5 seconds.

It is also possible to reproduce this with commands via /dev/tpm0.
The bug linked above has a python script attached which can be used to
test for this problem.  I tested a variety of TPMs from Infineon,
Nuvoton, Atmel, and STMicro but was only able to reproduce this with
LPC and I2C TPMs from Infineon.

The TPM specification only loosely defines this behavior:

  TPM Main Level 2 Part 3 v1.2 r116, section 3.3. TPM_SaveState:
  The TPM MAY declare all preserved values invalid in response to any
  command other than TPM_Init.

  TCG PC Client BIOS Spec 1.21 section 8.3.1.
  After issuing a TPM_SaveState command, the OS SHOULD NOT issue TPM
  commands before transitioning to S3 without issuing another
  TPM_SaveState command.

  TCG PC Client TIS 1.21, section 4. Power Management:
  The TPM_SaveState command allows a Static OS to indicate to the TPM
  that the platform may enter a low power state where the TPM will be
  required to enter into the D3 power state.  The use of the term "may"
  is significant in that there is no requirement for the platform to
  actually enter the low power state after sending the TPM_SaveState
  command.  The software may, in fact, send subsequent commands after
  sending the TPM_SaveState command.

Change-Id: I52b41e826412688e5b6c8ddd3bb16409939704e9
Signed-off-by: Duncan Laurie &lt;dlaurie@chromium.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the TPM has already been sent a SaveState command before the driver
is loaded it may have problems sending that same command again later.

This issue is seen with the Chromebook Pixel due to a firmware bug in
the legacy mode boot path which is sending the SaveState command
before booting the kernel.  More information is available at
http://crbug.com/203524

This change introduces a retry of the SaveState command in the suspend
path in order to work around this issue.  A future firmware update
should fix this but this is also a trivial workaround in the driver
that has no effect on systems that do not show this problem.

When this does happen the TPM responds with a non-fatal TPM_RETRY code
that is defined in the specification:

  The TPM is too busy to respond to the command immediately, but the
  command could be resubmitted at a later time.  The TPM MAY return
  TPM_RETRY for any command at any time.

It can take several seconds before the TPM will respond again.  I
measured a typical time between 3 and 4 seconds and the timeout is set
at a safe 5 seconds.

It is also possible to reproduce this with commands via /dev/tpm0.
The bug linked above has a python script attached which can be used to
test for this problem.  I tested a variety of TPMs from Infineon,
Nuvoton, Atmel, and STMicro but was only able to reproduce this with
LPC and I2C TPMs from Infineon.

The TPM specification only loosely defines this behavior:

  TPM Main Level 2 Part 3 v1.2 r116, section 3.3. TPM_SaveState:
  The TPM MAY declare all preserved values invalid in response to any
  command other than TPM_Init.

  TCG PC Client BIOS Spec 1.21 section 8.3.1.
  After issuing a TPM_SaveState command, the OS SHOULD NOT issue TPM
  commands before transitioning to S3 without issuing another
  TPM_SaveState command.

  TCG PC Client TIS 1.21, section 4. Power Management:
  The TPM_SaveState command allows a Static OS to indicate to the TPM
  that the platform may enter a low power state where the TPM will be
  required to enter into the D3 power state.  The use of the term "may"
  is significant in that there is no requirement for the platform to
  actually enter the low power state after sending the TPM_SaveState
  command.  The software may, in fact, send subsequent commands after
  sending the TPM_SaveState command.

Change-Id: I52b41e826412688e5b6c8ddd3bb16409939704e9
Signed-off-by: Duncan Laurie &lt;dlaurie@chromium.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/tpm_i2c_infineon: Add small comment about return value of __i2c_transfer</title>
<updated>2013-04-12T17:17:29+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peterhuewe@gmx.de</email>
</author>
<published>2013-03-04T21:17:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6aa4ef4dab92fc8d4f0e5ea735ae3fd520af510b'/>
<id>6aa4ef4dab92fc8d4f0e5ea735ae3fd520af510b</id>
<content type='text'>
Kent Yoder indicated that the code might be a bit clearer with a comment
here, so this patch adds a small explanation of the code.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Kent Yoder indicated that the code might be a bit clearer with a comment
here, so this patch adds a small explanation of the code.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/tpm_i2c_infineon.c: Add OF attributes type and name to the of_device_id table entries</title>
<updated>2013-04-12T17:17:29+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peterhuewe@gmx.de</email>
</author>
<published>2013-03-04T21:08:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=21dc02eab989d260fd9e22b72a29ac139a727cdd'/>
<id>21dc02eab989d260fd9e22b72a29ac139a727cdd</id>
<content type='text'>
As the subject says.
It's probably a good idea to have these fields populated.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the subject says.
It's probably a good idea to have these fields populated.

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm_i2c_stm_st33: Remove duplicate inclusion of header files</title>
<updated>2013-04-12T17:17:29+00:00</updated>
<author>
<name>Sachin Kamat</name>
<email>sachin.kamat@linaro.org</email>
</author>
<published>2013-03-06T08:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3320280b6fd7df65e3f211c0e4db66f637ca035f'/>
<id>3320280b6fd7df65e3f211c0e4db66f637ca035f</id>
<content type='text'>
module.h and sched.h were included twice.

Signed-off-by: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
module.h and sched.h were included twice.

Signed-off-by: Sachin Kamat &lt;sachin.kamat@linaro.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)</title>
<updated>2013-04-12T17:17:28+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peter.huewe@infineon.com</email>
</author>
<published>2013-03-04T14:41:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c61c86dd6e0a8037be73cf27212f389e46af60a4'/>
<id>c61c86dd6e0a8037be73cf27212f389e46af60a4</id>
<content type='text'>
This driver adds support for Infineon's new SLB 9645 TT 1.2 I2C TPMs,
which supports clockstretching, combined reads and a bus speed of
up to 400khz. The device also has a new device id.

The driver works now also fine with device trees, so you can
instantiate your device by adding:
 +       tpm {
 +               compatible = "infineon,slb9645tt";
 +               reg = &lt;0x20&gt;;
 +       };
 for SLB 9645 devices or

 +       tpm {
 +               compatible = "infineon,slb9635tt";
 +               reg = &lt;0x20&gt;;
 +       };
 for SLB 9635 devices

to your device tree.
tpm_i2c_infineon is also retained as a compatible id as a fallback to
slb9635 protocol.

The driver was tested on Beaglebone.

Signed-off-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This driver adds support for Infineon's new SLB 9645 TT 1.2 I2C TPMs,
which supports clockstretching, combined reads and a bus speed of
up to 400khz. The device also has a new device id.

The driver works now also fine with device trees, so you can
instantiate your device by adding:
 +       tpm {
 +               compatible = "infineon,slb9645tt";
 +               reg = &lt;0x20&gt;;
 +       };
 for SLB 9645 devices or

 +       tpm {
 +               compatible = "infineon,slb9635tt";
 +               reg = &lt;0x20&gt;;
 +       };
 for SLB 9635 devices

to your device tree.
tpm_i2c_infineon is also retained as a compatible id as a fallback to
slb9635 protocol.

The driver was tested on Beaglebone.

Signed-off-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>char/tpm: Convert struct i2c_msg initialization to C99 format</title>
<updated>2013-04-12T17:17:28+00:00</updated>
<author>
<name>Shubhrajyoti Datta</name>
<email>omaplinuxkernel@gmail.com</email>
</author>
<published>2013-02-28T10:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=eef8b6291987c059dacb07dd516d4ada0e3362af'/>
<id>eef8b6291987c059dacb07dd516d4ada0e3362af</id>
<content type='text'>
Convert the struct i2c_msg initialization to C99 format. This makes
maintaining and editing the code simpler. Also helps once other fields
like transferred are added in future.

Thanks to Julia Lawall for automating the conversion.

Signed-off-by: Shubhrajyoti D &lt;shubhrajyoti@ti.com&gt;
Acked-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Convert the struct i2c_msg initialization to C99 format. This makes
maintaining and editing the code simpler. Also helps once other fields
like transferred are added in future.

Thanks to Julia Lawall for automating the conversion.

Signed-off-by: Shubhrajyoti D &lt;shubhrajyoti@ti.com&gt;
Acked-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/char/tpm/tpm_ppi: use strlcpy instead of strncpy</title>
<updated>2013-04-12T17:17:28+00:00</updated>
<author>
<name>Chen Gang</name>
<email>gang.chen@asianux.com</email>
</author>
<published>2013-02-28T22:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e361200bfc3b72de8db246de209da55d6d60fd34'/>
<id>e361200bfc3b72de8db246de209da55d6d60fd34</id>
<content type='text'>
 Ensure that the 'version' string includes a NULL terminator after its
copied out of the acpi table.

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 Ensure that the 'version' string includes a NULL terminator after its
copied out of the acpi table.

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/tpm_i2c_stm_st33: formatting and white space changes</title>
<updated>2013-04-12T17:17:28+00:00</updated>
<author>
<name>Peter Huewe</name>
<email>peterhuewe@gmx.de</email>
</author>
<published>2013-02-28T22:15:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2d089f82aeb59fd58f33f2bbf4288e4049426e17'/>
<id>2d089f82aeb59fd58f33f2bbf4288e4049426e17</id>
<content type='text'>
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm/ibmvtpm: build only when IBM pseries is configured</title>
<updated>2013-02-14T15:36:50+00:00</updated>
<author>
<name>Kent Yoder</name>
<email>key@linux.vnet.ibm.com</email>
</author>
<published>2013-02-11T19:36:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5b2660326039a32b28766cb4c1a8b1bdcfadc375'/>
<id>5b2660326039a32b28766cb4c1a8b1bdcfadc375</id>
<content type='text'>
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tpm_tis: check pnp_acpi_device return code</title>
<updated>2013-02-05T15:38:26+00:00</updated>
<author>
<name>Kent Yoder</name>
<email>key@linux.vnet.ibm.com</email>
</author>
<published>2013-01-31T15:39:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6e38bfaad6c83bdd07eb659f9bfd50f8d71a5a46'/>
<id>6e38bfaad6c83bdd07eb659f9bfd50f8d71a5a46</id>
<content type='text'>
Reported-by: Peter Hüwe &lt;peterhuewe@gmx.de&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported-by: Peter Hüwe &lt;peterhuewe@gmx.de&gt;
Reviewed-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
