mbox series

[v2,0/3] char: tpm: Adjust cr50_i2c locking mechanism

Message ID 20221103145450.1409273-1-jsd@semihalf.com (mailing list archive)
Headers show
Series char: tpm: Adjust cr50_i2c locking mechanism | expand

Message

Jan Dąbroś Nov. 3, 2022, 2:54 p.m. UTC
This patchset aims to add support for a platforms with cr50(tpm) i2c
chip shared across two CPUs. We need to provide a mechanism, which will
allow to synchronize accesses on a TPM-transaction boundaries.

First commit in a patchset is a generic fix for an issue encountered
during suspend stress test.

Next two patches are modifying cr50 to use generic callbacks for
locality management and then leverage this solution to apply i2c bus
locking on a TPM-operation level.

v1->v2:
* Get back with tpm_cr50_check_locality to return 0 instead of locality
* Return from functions which get (locality < 0)

Jan Dabros (3):
  char: tpm: Protect tpm_pm_suspend with locks
  char: tpm: cr50: Use generic request/relinquish locality ops
  char: tpm: cr50: Move i2c locking to request/relinquish locality ops

 drivers/char/tpm/tpm-interface.c    |   5 +-
 drivers/char/tpm/tpm_tis_i2c_cr50.c | 126 ++++++++++++++++++----------
 2 files changed, 85 insertions(+), 46 deletions(-)