lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YCB60CRpdhb7/HZ+@kernel.org>
Date:   Mon, 8 Feb 2021 01:42:08 +0200
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     wanghongzhe <wanghongzhe@...wei.com>
Cc:     peterhuewe@....de, jgg@...pe.ca, linux-integrity@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] tpm_tis_spi_main: set cs_change = 0 when timesout

On Fri, Feb 05, 2021 at 02:42:05PM +0800, wanghongzhe wrote:
> when i reach TPM_RETRY, the cs cannot  change back to 'high'.
> So the TPM chips thinks this communication is not over.
> And next times communication cannot be effective because
> the communications mixed up with the last time.
> 
> Signed-off-by: wanghongzhe <wanghongzhe@...wei.com>
                 ~~~~~~~~~~~
                 Firstname Lastname

Please write legit sentences starting with capital letters etc.

Please write the commit message in imperative form. E.g. "Do x because y
..". I presume that *you* are not an actor in the sequence.

You also would need to have a fixes tag and preferably some description
of the failing sequence if possible.

/Jarkko

> ---
>  drivers/char/tpm/tpm_tis_spi_main.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
> index 3856f6ebcb34..6c52cbb28881 100644
> --- a/drivers/char/tpm/tpm_tis_spi_main.c
> +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> @@ -64,8 +64,18 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
>  				break;
>  		}
>  
> -		if (i == TPM_RETRY)
> +		if (i == TPM_RETRY) {
> +			/* change back to 'high',
> +			 * So the TPM chips thinks the last communication
> +			 * is done.
> +			 */
> +			spi_xfer.cs_change = 0;
> +			spi_xfer->len = 1;
> +			spi_message_init(&m);
> +			spi_message_add_tail(spi_xfer, &m);
> +			ret = spi_sync_locked(phy->spi_device, &m);
>  			return -ETIMEDOUT;
> +		}
>  	}
>  
>  	return 0;
> -- 
> 2.19.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ