Skip to content

Commit d5e65d1

Browse files
committed
Merge tag 'tpmdd-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux/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
2 parents 18aa0dd + f168c00 commit d5e65d1

File tree

8 files changed

+12
-3
lines changed

8 files changed

+12
-3
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23363,6 +23363,7 @@ Q: https://patchwork.kernel.org/project/linux-integrity/list/
2336323363
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
2336423364
F: Documentation/devicetree/bindings/tpm/
2336523365
F: drivers/char/tpm/
23366+
F: tools/testing/selftests/tpm2/
2336623367

2336723368
TPS546D24 DRIVER
2336823369
M: Duke Du <[email protected]>

drivers/char/tpm/st33zp24/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static void st33zp24_i2c_remove(struct i2c_client *client)
133133
}
134134

135135
static const struct i2c_device_id st33zp24_i2c_id[] = {
136-
{TPM_ST33_I2C, 0},
136+
{ TPM_ST33_I2C },
137137
{}
138138
};
139139
MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);

drivers/char/tpm/tpm-dev-common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ static ssize_t tpm_dev_transmit(struct tpm_chip *chip, struct tpm_space *space,
4747

4848
if (!ret)
4949
ret = tpm2_commit_space(chip, space, buf, &len);
50+
else
51+
tpm2_flush_space(chip);
5052

5153
out_rc:
5254
return ret ? ret : len;

drivers/char/tpm/tpm2-sessions.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,4 +1362,5 @@ int tpm2_sessions_init(struct tpm_chip *chip)
13621362

13631363
return rc;
13641364
}
1365+
EXPORT_SYMBOL(tpm2_sessions_init);
13651366
#endif /* CONFIG_TCG_TPM2_HMAC */

drivers/char/tpm/tpm2-space.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ void tpm2_flush_space(struct tpm_chip *chip)
169169
struct tpm_space *space = &chip->work_space;
170170
int i;
171171

172+
if (!space)
173+
return;
174+
172175
for (i = 0; i < ARRAY_SIZE(space->context_tbl); i++)
173176
if (space->context_tbl[i] && ~space->context_tbl[i])
174177
tpm2_flush_context(chip, space->context_tbl[i]);

drivers/char/tpm/tpm_i2c_atmel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static void i2c_atmel_remove(struct i2c_client *client)
186186
}
187187

188188
static const struct i2c_device_id i2c_atmel_id[] = {
189-
{I2C_DRIVER_NAME, 0},
189+
{ I2C_DRIVER_NAME },
190190
{}
191191
};
192192
MODULE_DEVICE_TABLE(i2c, i2c_atmel_id);

drivers/char/tpm/tpm_tis_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static void tpm_tis_i2c_remove(struct i2c_client *client)
375375
}
376376

377377
static const struct i2c_device_id tpm_tis_i2c_id[] = {
378-
{ "tpm_tis_i2c", 0 },
378+
{ "tpm_tis_i2c" },
379379
{}
380380
};
381381
MODULE_DEVICE_TABLE(i2c, tpm_tis_i2c_id);

tools/testing/selftests/tpm2/test_smoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
ksft_skip=4
66

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

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

0 commit comments

Comments
 (0)