diff options
author | Valdis Kletnieks <valdis.kletnieks@vt.edu> | 2008-10-16 01:04:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:49 -0400 |
commit | 292cf4a8a989cb564a6a5f0ba7a66e08a095afa1 (patch) | |
tree | 6db1701350102a4ee9aa19aac366e166db475a48 /drivers/char | |
parent | 9e5b1b12226d5a501fbc6706ca090e00d18a01ad (diff) |
tpm: work around bug in Broadcom BCM0102 chipset
Patch tpm-correct-tpm-timeouts-to-jiffies-conversion reveals a bug in the
Broadcom BCM0102 TPM chipset used in the Dell Latitude D820 - although
most of the timeouts are returned in usecs as per the spec, one is
apparently returned in msecs, which results in a too-small value leading
to a timeout when the code treats it as usecs. To prevent a regression,
we check for the known too-short value and adjust it to a value that makes
things work.
Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Marcin Obara <marcin_obara@users.sourceforge.net>
Cc: Marcel Selhorst <tpm@selhorst.net>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 6b5a0e0127a7..aa899cec6b3f 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -557,6 +557,13 @@ duration: | |||
557 | usecs_to_jiffies(be32_to_cpu | 557 | usecs_to_jiffies(be32_to_cpu |
558 | (*((__be32 *) (data + | 558 | (*((__be32 *) (data + |
559 | TPM_GET_CAP_RET_UINT32_1_IDX)))); | 559 | TPM_GET_CAP_RET_UINT32_1_IDX)))); |
560 | /* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above | ||
561 | * value wrong and apparently reports msecs rather than usecs. So we | ||
562 | * fix up the resulting too-small TPM_SHORT value to make things work. | ||
563 | */ | ||
564 | if (chip->vendor.duration[TPM_SHORT] < (HZ/100)) | ||
565 | chip->vendor.duration[TPM_SHORT] = HZ; | ||
566 | |||
560 | chip->vendor.duration[TPM_MEDIUM] = | 567 | chip->vendor.duration[TPM_MEDIUM] = |
561 | usecs_to_jiffies(be32_to_cpu | 568 | usecs_to_jiffies(be32_to_cpu |
562 | (*((__be32 *) (data + | 569 | (*((__be32 *) (data + |