]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/linux/tpm.h
tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd()
authorAzhar Shaikh <azhar.shaikh@intel.com>
Fri, 22 Dec 2017 20:13:44 +0000 (12:13 -0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 15 Mar 2018 21:29:12 +0000 (18:29 -0300)
commit371ef88c12e4a57d9ad9c897628947020b4ca7a5
treee83c3049b8bc8c0aa5df639e3b9b914bbd29e647
parenta4e235c571459a71874477ce67c97629de6a61c7
tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd()

BugLink: http://bugs.launchpad.net/bugs/1756100
commit b3e958ce4c585bf666de249dc794971ebc62d2d3 upstream.

Commit 5e572cab92f0bb5 ("tpm: Enable CLKRUN protocol for Braswell
systems") disabled CLKRUN protocol during TPM transactions and re-enabled
once the transaction is completed. But there were still some corner cases
observed where, reading of TPM header failed for savestate command
while going to suspend, which resulted in suspend failure.
To fix this issue keep the CLKRUN protocol disabled for the entire
duration of a single TPM command and not disabling and re-enabling
again for every TPM transaction. For the other TPM accesses outside
TPM command flow, add a higher level of disabling and re-enabling
the CLKRUN protocol, instead of doing for every TPM transaction.

Fixes: 5e572cab92f0bb5 ("tpm: Enable CLKRUN protocol for Braswell systems")
Signed-off-by: Azhar Shaikh <azhar.shaikh@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm_tis.c
drivers/char/tpm/tpm_tis_core.c
drivers/char/tpm/tpm_tis_core.h
include/linux/tpm.h