Re: [PATCH v10 3/8] tpm: tpm_tis: Add retry in case of protocol failure or data integrity (on I2C only) failure.

From: Jarkko Sakkinen
Date: Tue Jun 16 2020 - 21:17:27 EST


On Thu, Jun 04, 2020 at 04:47:08PM +0300, amirmizi6@xxxxxxxxx wrote:
> From: Amir Mizinski <amirmizi6@xxxxxxxxx>
>
> The FIFO protocol described in the TCG PC Client Device Driver Design
> Principles for TPM 2.0 advises retrying sending a command or receiving
> a response using the FIFO protocol in case of any error in the protocol.
>
> Add a retry mechanism on any protocol error. In addition, in case of a data
> integrity issue in the I2C bus protocol, check after sending a command
> completion or receiving a response from the TPM.

The first sentence of this paragraph means absolutely nothing but
nonsense. Please describe the implementation broadly instead.

Also the code is organized badly and makes the current code base a mess.
You should derive __tpm_tis_recv() from the "old" tpm_tis_recv(), and
introduce a "new" tpm_tis_recv() that calls __tpm_tis_recv() a number of
times.

/Jarkko