Copy tpm-fix-stall-on-boot.patch from rawhide tree. (#530393)

This commit is contained in:
Kyle McMartin 2010-12-09 17:06:27 -05:00
parent 983a2bb5c5
commit bd61adb09d
2 changed files with 30 additions and 0 deletions

View File

@ -779,6 +779,7 @@ Patch13641: mmc-make-sdhci-work-with-ricoh-mmc-controller.patch
Patch13642: mmc-add-ricoh-e822-pci-id.patch
Patch13645: tpm-autodetect-itpm-devices.patch
Patch13646: tpm-fix-stall-on-boot.patch
Patch13651: kvm-fix-fs-gs-reload-oops-with-invalid-ldt.patch
@ -1484,6 +1485,8 @@ ApplyPatch mmc-make-sdhci-work-with-ricoh-mmc-controller.patch
ApplyPatch mmc-add-ricoh-e822-pci-id.patch
ApplyPatch tpm-autodetect-itpm-devices.patch
# rhbz#530393
ApplyPatch tpm-fix-stall-on-boot.patch
# CVE-2010-3698
ApplyPatch kvm-fix-fs-gs-reload-oops-with-invalid-ldt.patch
@ -2108,6 +2111,9 @@ fi
# and build.
%changelog
* Thu Dec 09 2010 Kyle McMartin <kyle@redhat.com>
- Copy tpm-fix-stall-on-boot.patch from rawhide tree. (#530393)
* Thu Dec 09 2010 Chuck Ebbert <cebbert@redhat.com> 2.6.35.9-65
- Require newt-devel for building perf, to enable the perf TUI (#661180)

View File

@ -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);