- 15 2月, 2015 1 次提交
-
-
由 Jarkko Sakkinen 提交于
Fixed suspend/resume paths for TPM 2.0 and consolidated all the associated code to the tpm_pm_suspend() and tpm_pm_resume() functions. Resume path should be handled by the firmware, i.e. Startup(CLEAR) for hibernate and Startup(STATE) for suspend. There might be some non-PC embedded devices in the future where Startup() is not the handled by the FW but fixing the code for those IMHO should be postponed until there is hardware available to test the fixes although extra Startup in the driver code is essentially a NOP. Added Shutdown(CLEAR) to the remove paths of TIS and CRB drivers. Changed tpm2_shutdown() to a void function because there isn't much you can do except print an error message if this fails with a system error. Fixes: aec04cbd ("tpm: TPM 2.0 FIFO Interface") Fixes: 30fc8d13 ("tpm: TPM 2.0 CRB Interface") [phuewe: both did send TPM_Shutdown on resume which 'disables' the TPM and did not send TPM2_Shutdown on teardown which leads some TPM2.0 to believe there was an attack (no TPM2_Shutdown = no orderly shutdown = attack)] Reported-by: NPeter Hüwe <PeterHuewe@gmx.de> Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: NScot Doyle <lkml14@scotdoyle.com> Reviewed-by: NPeter Huewe <peterhuewe@gmx.de> Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
-
- 17 1月, 2015 1 次提交
-
-
由 Jarkko Sakkinen 提交于
TPM 2.0 devices are separated by adding a field 'flags' to struct tpm_chip and defining a flag TPM_CHIP_FLAG_TPM2 for tagging them. This patch adds the following internal functions: - tpm2_get_random() - tpm2_get_tpm_pt() - tpm2_pcr_extend() - tpm2_pcr_read() - tpm2_startup() Additionally, the following exported functions are implemented for implementing TPM 2.0 device drivers: - tpm2_do_selftest() - tpm2_calc_ordinal_durations() - tpm2_gen_interrupt() The existing functions that are exported for the use for existing subsystems have been changed to check the flags field in struct tpm_chip and use appropriate TPM 2.0 counterpart if TPM_CHIP_FLAG_TPM2 is est. The code for tpm2_calc_ordinal_duration() and tpm2_startup() were originally written by Will Arthur. Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: NWill Arthur <will.c.arthur@intel.com> Reviewed-by: NJasob Gunthorpe <jason.gunthorpe@obsidianresearch.com> Reviewed-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: NPeter Huewe <peterhuewe@gmx.de> Tested-by: NPeter Huewe <peterhuewe@gmx.de> [phuewe: Fixed copy paste error * 2] Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
-