diff options
author | Claudio Carvalho <cclaudio@linux.vnet.ibm.com> | 2016-11-28 01:08:09 -0200 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-11-29 18:17:02 +1100 |
commit | 300c734b628f73aa72e72d47139d7f53582d8b19 (patch) | |
tree | 8c91692c180b1bf551d47737be85042a3946fb40 | |
parent | 6f717d125733d1cc0aef5f8fca2229a861c144c6 (diff) | |
download | skiboot-300c734b628f73aa72e72d47139d7f53582d8b19.zip skiboot-300c734b628f73aa72e72d47139d7f53582d8b19.tar.gz skiboot-300c734b628f73aa72e72d47139d7f53582d8b19.tar.bz2 |
tpm_i2c_nuvoton: handle errors after writing sts.commandReady in step 5
This adds code to handle errors after writting the sts.commandReady to
release the tpm.
Fixes: 56ad053c3e8bf0764ad5878cb018f00a389d30cf
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | libstb/drivers/tpm_i2c_nuvoton.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libstb/drivers/tpm_i2c_nuvoton.c b/libstb/drivers/tpm_i2c_nuvoton.c index aba7211..1c1fd37 100644 --- a/libstb/drivers/tpm_i2c_nuvoton.c +++ b/libstb/drivers/tpm_i2c_nuvoton.c @@ -455,8 +455,18 @@ static int tpm_transmit(struct tpm_dev *dev, uint8_t* buf, size_t cmdlen, if (rc < 0) goto out; - DBG("step 5/5: write command ready\n"); + DBG("step 5/5: release tpm\n"); rc = tpm_status_write_byte(TPM_STS_COMMAND_READY); + if (rc < 0) { + /** + * @fwts-label TPMReleaseTpm + * @fwts-advice Either the tpm device or the tpm-i2c interface + * doesn't seem to be working properly. Check the return code + * (rc) for further details. + */ + prlog(PR_ERR, "NUVOTON: fail to release tpm, rc=%d\n", rc); + rc = STB_DRIVER_ERROR; + } out: DBG("**** tpm_transmit %s, rc=%d ****\n", |