Skip to content

Commit

Permalink
Merge tag 'tpmdd-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/jarkko/linux-tpmdd

Pull tpm updates from Jarkko Sakkinen:
 "Just updates and fixes, no major changes"

* tag 'tpmdd-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm: export tpm2_sessions_init() to fix ibmvtpm building
  tpm: Drop explicit initialization of struct i2c_device_id::driver_data to 0
  selftests: tpm2: test_smoke: Run only when TPM2 is avaialable.
  MAINTAINERS: Add selftest files to TPM section
  tpm: Clean up TPM space after command failure
  • Loading branch information
Linus Torvalds committed Sep 19, 2024
2 parents 18aa0dd + f168c00 commit d5e65d1
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -23363,6 +23363,7 @@ Q: https://patchwork.kernel.org/project/linux-integrity/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
F: Documentation/devicetree/bindings/tpm/
F: drivers/char/tpm/
F: tools/testing/selftests/tpm2/

TPS546D24 DRIVER
M: Duke Du <dukedu83@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/tpm/st33zp24/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void st33zp24_i2c_remove(struct i2c_client *client)
}

static const struct i2c_device_id st33zp24_i2c_id[] = {
{TPM_ST33_I2C, 0},
{ TPM_ST33_I2C },
{}
};
MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
Expand Down
2 changes: 2 additions & 0 deletions drivers/char/tpm/tpm-dev-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static ssize_t tpm_dev_transmit(struct tpm_chip *chip, struct tpm_space *space,

if (!ret)
ret = tpm2_commit_space(chip, space, buf, &len);
else
tpm2_flush_space(chip);

out_rc:
return ret ? ret : len;
Expand Down
1 change: 1 addition & 0 deletions drivers/char/tpm/tpm2-sessions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,4 +1362,5 @@ int tpm2_sessions_init(struct tpm_chip *chip)

return rc;
}
EXPORT_SYMBOL(tpm2_sessions_init);
#endif /* CONFIG_TCG_TPM2_HMAC */
3 changes: 3 additions & 0 deletions drivers/char/tpm/tpm2-space.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ void tpm2_flush_space(struct tpm_chip *chip)
struct tpm_space *space = &chip->work_space;
int i;

if (!space)
return;

for (i = 0; i < ARRAY_SIZE(space->context_tbl); i++)
if (space->context_tbl[i] && ~space->context_tbl[i])
tpm2_flush_context(chip, space->context_tbl[i]);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/tpm/tpm_i2c_atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void i2c_atmel_remove(struct i2c_client *client)
}

static const struct i2c_device_id i2c_atmel_id[] = {
{I2C_DRIVER_NAME, 0},
{ I2C_DRIVER_NAME },
{}
};
MODULE_DEVICE_TABLE(i2c, i2c_atmel_id);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/tpm/tpm_tis_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static void tpm_tis_i2c_remove(struct i2c_client *client)
}

static const struct i2c_device_id tpm_tis_i2c_id[] = {
{ "tpm_tis_i2c", 0 },
{ "tpm_tis_i2c" },
{}
};
MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_id);
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/tpm2/test_smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
ksft_skip=4

[ -e /dev/tpm0 ] || exit $ksft_skip
read tpm_version < /sys/class/tpm/tpm0/tpm_version_major
[ "$tpm_version" == 2 ] || exit $ksft_skip

python3 -m unittest -v tpm2_tests.SmokeTest 2>&1

0 comments on commit d5e65d1

Please sign in to comment.