summaryrefslogtreecommitdiffstats
path: root/tpm-fix-stall-on-boot.patch
diff options
context:
space:
mode:
authorChuck Ebbert <cebbert@redhat.com>2010-09-02 09:46:36 -0400
committerChuck Ebbert <cebbert@redhat.com>2010-09-02 09:46:36 -0400
commite9ce60f6ef994c8f98c09d8ebc812fea87ca395c (patch)
tree6843cc5b9e26ec97b65039616692ff7c55e365a4 /tpm-fix-stall-on-boot.patch
parent3285fcda470ebafa7879262794129c9c7ed15a08 (diff)
downloadkernel-e9ce60f6ef994c8f98c09d8ebc812fea87ca395c.tar.gz
kernel-e9ce60f6ef994c8f98c09d8ebc812fea87ca395c.tar.xz
kernel-e9ce60f6ef994c8f98c09d8ebc812fea87ca395c.zip
tpm-fix-stall-on-boot.patch: attempt to fix stalls during boot (#530393)
Diffstat (limited to 'tpm-fix-stall-on-boot.patch')
-rw-r--r--tpm-fix-stall-on-boot.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/tpm-fix-stall-on-boot.patch b/tpm-fix-stall-on-boot.patch
new file mode 100644
index 000000000..adba40a6e
--- /dev/null
+++ b/tpm-fix-stall-on-boot.patch
@@ -0,0 +1,24 @@
+Fix TPM timeouts on boot (#530393)
+
+--- a/drivers/char/tpm/tpm.c
++++ a/drivers/char/tpm/tpm.c
+@@ -354,12 +354,14 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
+ tpm_protected_ordinal_duration[ordinal &
+ TPM_PROTECTED_ORDINAL_MASK];
+
+- if (duration_idx != TPM_UNDEFINED)
++ if (duration_idx != TPM_UNDEFINED) {
+ duration = chip->vendor.duration[duration_idx];
+- if (duration <= 0)
++ /* if duration is 0, it's because chip->vendor.duration wasn't */
++ /* filled yet, so we set the lowest timeout just to give enough */
++ /* time to tpm_get_timeouts() succeed */
++ return (duration <= 0 ? HZ : duration);
++ } else
+ return 2 * 60 * HZ;
+- else
+- return duration;
+ }
+ EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
+
+