commit cca56d7b550bac0a00d6322b225f4d0a8d3e6b88 Author: David Smith Date: Tue Apr 28 18:56:39 2009 +0900 Fix tpm_tis driver to support either DATA_EXPECT or VALID status when uploading command data. The TCG spec says that a VALID status implies that a DATA_EXPECT status. This occurs in the real world with the iTPM in Intel's Mobile 4 platform which never sets DATA_EXPECT, but sets VALID when expecting more data. Signed-off-by: David Smith diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index aec1931..be112ef 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -293,7 +293,8 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len) wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &chip->vendor.int_queue); status = tpm_tis_status(chip); - if ((status & TPM_STS_DATA_EXPECT) == 0) { + if ((status & TPM_STS_DATA_EXPECT) == 0 && + (status & TPM_STS_VALID) == 0) { rc = -EIO; goto out_err; } @@ -306,7 +307,8 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len) wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &chip->vendor.int_queue); status = tpm_tis_status(chip); - if ((status & TPM_STS_DATA_EXPECT) != 0) { + if ((status & TPM_STS_DATA_EXPECT) != 0 && + (status & TPM_STS_VALID) == 1) { rc = -EIO; goto out_err; }