|
@@ -39,8 +39,7 @@ static void tpm2_flush_sessions(struct tpm_chip *chip, struct tpm_space *space)
|
|
for (i = 0; i < ARRAY_SIZE(space->session_tbl); i++) {
|
|
for (i = 0; i < ARRAY_SIZE(space->session_tbl); i++) {
|
|
if (space->session_tbl[i])
|
|
if (space->session_tbl[i])
|
|
tpm2_flush_context_cmd(chip, space->session_tbl[i],
|
|
tpm2_flush_context_cmd(chip, space->session_tbl[i],
|
|
- TPM_TRANSMIT_UNLOCKED |
|
|
|
|
- TPM_TRANSMIT_RAW);
|
|
|
|
|
|
+ TPM_TRANSMIT_NESTED);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -85,7 +84,7 @@ static int tpm2_load_context(struct tpm_chip *chip, u8 *buf,
|
|
tpm_buf_append(&tbuf, &buf[*offset], body_size);
|
|
tpm_buf_append(&tbuf, &buf[*offset], body_size);
|
|
|
|
|
|
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 4,
|
|
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 4,
|
|
- TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW, NULL);
|
|
|
|
|
|
+ TPM_TRANSMIT_NESTED, NULL);
|
|
if (rc < 0) {
|
|
if (rc < 0) {
|
|
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
|
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
|
__func__, rc);
|
|
__func__, rc);
|
|
@@ -134,7 +133,7 @@ static int tpm2_save_context(struct tpm_chip *chip, u32 handle, u8 *buf,
|
|
tpm_buf_append_u32(&tbuf, handle);
|
|
tpm_buf_append_u32(&tbuf, handle);
|
|
|
|
|
|
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 0,
|
|
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 0,
|
|
- TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW, NULL);
|
|
|
|
|
|
+ TPM_TRANSMIT_NESTED, NULL);
|
|
if (rc < 0) {
|
|
if (rc < 0) {
|
|
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
|
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
|
__func__, rc);
|
|
__func__, rc);
|
|
@@ -171,8 +170,7 @@ static void tpm2_flush_space(struct tpm_chip *chip)
|
|
for (i = 0; i < ARRAY_SIZE(space->context_tbl); i++)
|
|
for (i = 0; i < ARRAY_SIZE(space->context_tbl); i++)
|
|
if (space->context_tbl[i] && ~space->context_tbl[i])
|
|
if (space->context_tbl[i] && ~space->context_tbl[i])
|
|
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
|
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
|
- TPM_TRANSMIT_UNLOCKED |
|
|
|
|
- TPM_TRANSMIT_RAW);
|
|
|
|
|
|
+ TPM_TRANSMIT_NESTED);
|
|
|
|
|
|
tpm2_flush_sessions(chip, space);
|
|
tpm2_flush_sessions(chip, space);
|
|
}
|
|
}
|
|
@@ -379,8 +377,7 @@ static int tpm2_map_response_header(struct tpm_chip *chip, u32 cc, u8 *rsp,
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
out_no_slots:
|
|
out_no_slots:
|
|
- tpm2_flush_context_cmd(chip, phandle,
|
|
|
|
- TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW);
|
|
|
|
|
|
+ tpm2_flush_context_cmd(chip, phandle, TPM_TRANSMIT_NESTED);
|
|
dev_warn(&chip->dev, "%s: out of slots for 0x%08X\n", __func__,
|
|
dev_warn(&chip->dev, "%s: out of slots for 0x%08X\n", __func__,
|
|
phandle);
|
|
phandle);
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -468,8 +465,7 @@ static int tpm2_save_space(struct tpm_chip *chip)
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
|
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
|
- TPM_TRANSMIT_UNLOCKED |
|
|
|
|
- TPM_TRANSMIT_RAW);
|
|
|
|
|
|
+ TPM_TRANSMIT_NESTED);
|
|
space->context_tbl[i] = ~0;
|
|
space->context_tbl[i] = ~0;
|
|
}
|
|
}
|
|
|
|
|