tpm_tis: Move CRC check to generic send routine
authorAlexander Steffen <Alexander.Steffen@infineon.com>
Tue, 13 Jun 2023 18:02:57 +0000 (20:02 +0200)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 17 Aug 2023 20:12:41 +0000 (20:12 +0000)
commit32a0c860ff48543299772f7a98f32dd3ee9281b7
tree206cfaa59e1a795803bceea8fe74660a8a19b955
parenta86a42ac2bd652fdc7836a9d880c306a2485c142
tpm_tis: Move CRC check to generic send routine

The CRC functionality is initialized before tpm_tis_core, so it can be used
on all code paths within the module. Therefore, move the CRC check to the
generic send routine, that also contains all other checks for successful
command transmission, so that all those checks are in one place.

Also, this ensures that tpm_tis_ready is called when a CRC failure is
detected, to clear the invalid data from the TPM, which did not happen
previously.

Signed-off-by: Alexander Steffen <Alexander.Steffen@infineon.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_tis_core.c