tpm_tis: TPM_STS_DATA_EXPECT workaround
authorRajiv Andrade <srajiv@linux.vnet.ibm.com>
Thu, 10 Sep 2009 20:09:35 +0000 (17:09 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Mar 2010 15:49:42 +0000 (08:49 -0700)
commitc58f49beb5837d0216adb291e3b073bf9ffcc6b7
treec17c22570b4b1c99dc06455a825265850a6b1e36
parent3f0fdaebcd434fd9d5343f3ccccb22a9fb5381d4
tpm_tis: TPM_STS_DATA_EXPECT workaround

commit 3507d612366a4e81226295f646410130a1f62a5c upstream.

Some newer Lenovo models are shipped with a TPM that doesn't seem to set the TPM_STS_DATA_EXPECT status bit
when sending it a burst of data, so the code understands it as a failure and doesn't proceed sending the chip
the intended data. In this patch we bypass this bit check in case the itpm module parameter was set.

This patch is based on Andy Isaacson's one:

http://marc.info/?l=linux-kernel&m=124650185023495&w=2

It was heavily discussed how should we deal with identifying the chip in kernel space, but the required
patch to do so was NACK'd:

http://marc.info/?l=linux-kernel&m=124650186423711&w=2

This way we let the user choose using this workaround or not based on his
observations on this code behavior when trying to use the TPM.

Fixed a checkpatch issue present on the previous patch, thanks to Daniel Walker.

Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com>
Tested-by: Seiji Munetoh <seiji.munetoh@gmail.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tpm/tpm_tis.c