2020-01-14 11:59:04

by wanghongzhe

[permalink] [raw]
Subject: [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout

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 <[email protected]>
---
drivers/char/tpm/tpm_tis_spi.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index d1754fd..a1ae4f6 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -67,7 +67,14 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
}

if (i == TPM_RETRY)
+ {
+ 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;
--
1.7.12.4


2020-01-14 12:14:04

by Paul Menzel

[permalink] [raw]
Subject: Re: [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout

Dear wanghongzhe,


On 2020-01-14 13:31, wanghongzhe wrote:

Your message is from the future (Date: Tue, 14 Jan 2020 20:31:59 +0800).

Please fix your clock. ;-)

Subject: Set cs_change to 0 in case of time-out

> when i reach TPM_RETRY, the cs cannot change back to 'high'.So the TPM chips thinks this communication is not over.

Space after the dot/period.

> And next times communication cannot be effective because the communications mixed up with the last time.
>
> Signed-off-by: wanghongzhe <[email protected]>

If you’d configure your name as Wang Hongzhe (or similar) it’d be much
appreciated (`git config --global user.name "Wang …").

[…]


Kind regards,

Paul


Attachments:
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature

2020-01-14 12:34:11

by wanghongzhe

[permalink] [raw]
Subject: 答复: [PATCH] tpm: tpm_tis_spi: set cs_chan ge = 0 when timesout

Sorry, I have change these mistakes in another emails

-----邮件原件-----
发件人: Paul Menzel [mailto:[email protected]]
发送时间: 2020年1月14日 20:13
收件人: wanghongzhe <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; Zhangchenfeng (EulerOS) <[email protected]>
主题: Re: [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout

Dear wanghongzhe,


On 2020-01-14 13:31, wanghongzhe wrote:

Your message is from the future (Date: Tue, 14 Jan 2020 20:31:59 +0800).

Please fix your clock. ;-)

Subject: Set cs_change to 0 in case of time-out

> when i reach TPM_RETRY, the cs cannot change back to 'high'.So the TPM chips thinks this communication is not over.

Space after the dot/period.

> And next times communication cannot be effective because the communications mixed up with the last time.
>
> Signed-off-by: wanghongzhe <[email protected]>

If you’d configure your name as Wang Hongzhe (or similar) it’d be much
appreciated (`git config --global user.name "Wang …").

[…]


Kind regards,

Paul