Re: [RFC][PATCH 6/9] tpm_tis_spi: fix sending wrong data during wait state handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 08, 2017 at 07:46:55PM +0100, Alexander Steffen wrote:
> When the TPM signals wait states, the driver has to repeat the last byte
> until the TPM stops signaling wait states and accepts that byte. It should
> not send a dummy byte, even though that might work with some TPM
> implementations.
> 
> Signed-off-by: Alexander Steffen <Alexander.Steffen@xxxxxxxxxxxx>
> ---
>  drivers/char/tpm/tpm_tis_spi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
> index c4f511b..2758b41 100644
> --- a/drivers/char/tpm/tpm_tis_spi.c
> +++ b/drivers/char/tpm/tpm_tis_spi.c
> @@ -88,9 +88,8 @@ static int tpm_tis_spi_transfer(struct tpm_tis_data *data, u32 addr, u16 len,
>  
>  		if ((phy->iobuf[3] & 0x01) == 0) {
>  			// handle SPI wait states
> -			phy->iobuf[0] = 0;
> -
>  			for (i = 0; i < TPM_RETRY; i++) {
> +				phy->iobuf[0] = addr;

Why it has to be moved inside the loop?

/Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux