tpm-fix-stall-on-boot.patch: attempt to fix stalls during boot (#530393)

This commit is contained in:
Chuck Ebbert 2010-09-02 09:46:36 -04:00
parent 3285fcda47
commit e9ce60f6ef
2 changed files with 30 additions and 0 deletions

View File

@ -693,6 +693,8 @@ Patch12018: neuter_intel_microcode_load.patch
Patch12020: alsa-fix-substream-proc-status-read.patch
Patch12030: tpm-fix-stall-on-boot.patch
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@ -1264,6 +1266,9 @@ ApplyPatch disable-i8042-check-on-apple-mac.patch
ApplyPatch neuter_intel_microcode_load.patch
# try to fix stalls during boot (#530393)
ApplyPatch tpm-fix-stall-on-boot.patch
# END OF PATCH APPLICATIONS
%endif
@ -1873,6 +1878,7 @@ fi
%changelog
* Thu Sep 02 2010 Chuck Ebbert <cebbert@redhat.com> - 2.6.36-0.15.rc3.git0
- Add patch from ALSA mailing list to try to fix bug #628404
- tpm-fix-stall-on-boot.patch: attempt to fix stalls during boot (#530393)
* Wed Sep 01 2010 Kyle McMartin <kyle@redhat.com> - 2.6.36-0.14.rc3.git0
- Fix icebp breakpoints, patch from Frederic Weisbecker.

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