aboutsummaryrefslogtreecommitdiff
path: root/libstb
diff options
context:
space:
mode:
authorClaudio Carvalho <cclaudio@linux.vnet.ibm.com>2016-11-28 01:08:08 -0200
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-29 18:17:02 +1100
commit6f717d125733d1cc0aef5f8fca2229a861c144c6 (patch)
treeb4731e36051572b2dda0f11b489ba35ab4c62b65 /libstb
parent454d0be05bcd1de6ea263c9b625a63a57a6098fc (diff)
downloadskiboot-6f717d125733d1cc0aef5f8fca2229a861c144c6.zip
skiboot-6f717d125733d1cc0aef5f8fca2229a861c144c6.tar.gz
skiboot-6f717d125733d1cc0aef5f8fca2229a861c144c6.tar.bz2
tpm_i2c_nuvoton: handle errors after writing sts.go
This handles errors returned by the tpm-i2c interface after writing sts.go in tpm_transmit(). Fixes: 56ad053c3e8bf0764ad5878cb018f00a389d30cf Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libstb')
-rw-r--r--libstb/drivers/tpm_i2c_nuvoton.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libstb/drivers/tpm_i2c_nuvoton.c b/libstb/drivers/tpm_i2c_nuvoton.c
index 62236e4..aba7211 100644
--- a/libstb/drivers/tpm_i2c_nuvoton.c
+++ b/libstb/drivers/tpm_i2c_nuvoton.c
@@ -436,10 +436,19 @@ static int tpm_transmit(struct tpm_dev *dev, uint8_t* buf, size_t cmdlen,
if (rc < 0)
goto out;
- DBG("step 3/5: write tpmgo\n");
+ DBG("step 3/5: write sts.go\n");
rc = tpm_status_write_byte(TPM_STS_GO);
- if (rc < 0)
+ if (rc < 0) {
+ /**
+ * @fwts-label TPMWriteGo
+ * @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 write sts.go, rc=%d\n", rc);
+ rc = STB_DRIVER_ERROR;
goto out;
+ }
DBG("step 4/5: read FIFO\n");
rc = tpm_read_fifo(buf, buflen);