]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.drivers/tpm-bcm0102-workaround.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / tpm-bcm0102-workaround.patch
1 From 292cf4a8a989cb564a6a5f0ba7a66e08a095afa1 Mon Sep 17 00:00:00 2001
2 From: Valdis Kletnieks <valdis.kletnieks@vt.edu>
3 Date: Wed, 15 Oct 2008 22:04:35 -0700
4 Subject: [PATCH] tpm: work around bug in Broadcom BCM0102 chipset
5 Patch-mainline: 2.6.28
6 References: bnc#425747 FATE304221
7
8 Patch tpm-correct-tpm-timeouts-to-jiffies-conversion reveals a bug in the
9 Broadcom BCM0102 TPM chipset used in the Dell Latitude D820 - although
10 most of the timeouts are returned in usecs as per the spec, one is
11 apparently returned in msecs, which results in a too-small value leading
12 to a timeout when the code treats it as usecs. To prevent a regression,
13 we check for the known too-short value and adjust it to a value that makes
14 things work.
15
16 Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
17 Cc: Marcin Obara <marcin_obara@users.sourceforge.net>
18 Cc: Marcel Selhorst <tpm@selhorst.net>
19 Cc: Kylene Jo Hall <kjhall@us.ibm.com>
20 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
21 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 Signed-off-by: Jiri Slaby <jslaby@suse.cz>
23 ---
24 drivers/char/tpm/tpm.c | 7 +++++++
25 1 files changed, 7 insertions(+), 0 deletions(-)
26
27 diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
28 index 6b5a0e0..aa899ce 100644
29 --- a/drivers/char/tpm/tpm.c
30 +++ b/drivers/char/tpm/tpm.c
31 @@ -557,6 +557,13 @@ duration:
32 usecs_to_jiffies(be32_to_cpu
33 (*((__be32 *) (data +
34 TPM_GET_CAP_RET_UINT32_1_IDX))));
35 + /* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above
36 + * value wrong and apparently reports msecs rather than usecs. So we
37 + * fix up the resulting too-small TPM_SHORT value to make things work.
38 + */
39 + if (chip->vendor.duration[TPM_SHORT] < (HZ/100))
40 + chip->vendor.duration[TPM_SHORT] = HZ;
41 +
42 chip->vendor.duration[TPM_MEDIUM] =
43 usecs_to_jiffies(be32_to_cpu
44 (*((__be32 *) (data +
45 --
46 1.6.0.2
47