char/tpm_tis_i2c: minor bugfixes and cleanups
authorPeter Huewe <huewe.external@infineon.com>
Mon, 4 Apr 2011 17:32:05 +0000 (10:32 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 1 Jun 2012 06:53:30 +0000 (23:53 -0700)
commitd5318b6b43b6477ededd642674a419bf0e8ab155
tree6ce648fc83ba1ca0b9633ac19449bc5c8f9e8e8f
parent4a28387820435a56b17ae1784b391de5f66fe6f3
char/tpm_tis_i2c: minor bugfixes and cleanups

This patchset consists of minor bugfixes and cleanups to the Infineon
IFX TPM TIS I2C Driver.
These patches were already sent to the TPM Maintainer who is currently
reviewing the driver.

The patchset consists of these patches:

char/tpm: Fix cleanup behavior if no hardware is attached in tpm_tis_i2c.c

This patch fixes the cleanup behavior if no hardware is attached, by fixing the
exit points.

Without this patch the driver fails to release the registered minor number if
no hardware is attached.
Moreover if the driver gets called 256 times without the hardware attached,
tpm_register_hardware runs out of device numbers and consequently fails and
tpm_remove_hardware gets called with a NULL pointer, leading to an OOPS.

char/tpm: spellcheck and version bump for tpm_tis_i2c.c

This patch fixes a small typo and bumps the version of tpm_tis_i2c.c to 2.1.1

char/tpm: workaround: TPM can't handle more than 0x4f9 bytes

If the TPM (beta firmware) receives more than 0x4f9 Bytes the TPM shuts itself
down. Since this is usually not the desired behavior the driver has to workaound
this bug by blocking any input over 0x4f9 (1273) bytes.
We chose 1260 as an (arbitrary) upper limit, just to be on the safe side.

char/tpm: don't bypass timeout mechanism for burstcount

If the tpm keeps on reporting burstcount == 0 the driver gets into an endless
loop. This patch fixes this by removing the bypass of the timeout mechanism for
burstcount.
If burstcount == 0 (for some time) the driver now returns gracefully with a
 -EBUSY.

char/tpm_tis_i2c: Update driver to proposed mainline version

This patch updates the tpm_tis_i2c.c driver to the version that was sent
to the LKML.

The patch fixes some spelling errors and bumps the version to 2.1.0
The patch is needed to apply the upcomming patches cleanly.

Change-Id: I95ca3ea90cc4976d3e4f5f19aa37d3f72e0703c2

BUG=
TEST=Running the trousers testsuite several times, manual tests, IFX LinuxDD testsuite
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Review URL: http://codereview.chromium.org/6794015
drivers/char/tpm/tpm_tis_i2c.c