tpm: Keep CLKRUN enabled throughout the duration of transmit_cmd()
Commit5e572cab92
("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:5e572cab92
("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>
This commit is contained in:

committed by
Jarkko Sakkinen

parent
c382babccb
commit
b3e958ce4c
@@ -425,6 +425,9 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
|
||||
if (chip->dev.parent)
|
||||
pm_runtime_get_sync(chip->dev.parent);
|
||||
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
chip->ops->clk_enable(chip, true);
|
||||
|
||||
/* Store the decision as chip->locality will be changed. */
|
||||
need_locality = chip->locality == -1;
|
||||
|
||||
@@ -501,6 +504,9 @@ out:
|
||||
chip->locality = -1;
|
||||
}
|
||||
out_no_locality:
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
chip->ops->clk_enable(chip, false);
|
||||
|
||||
if (chip->dev.parent)
|
||||
pm_runtime_put_sync(chip->dev.parent);
|
||||
|
||||
|
Reference in New Issue
Block a user