linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm:tpm_tis_spi: set cs_change = 0 when timesout
@ 2020-01-15  7:09 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2020-01-15  7:09 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1, wanghongzhe

From: Wang Hongzhe <wanghongzhe@huawei.com>

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: Wang Hongzhe <wanghongzhe@huawei.com>
---
 drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index d1754fd..27e57bf 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -66,8 +66,15 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
 				break;
 		}
 
-		if (i == TPM_RETRY)
+		if (i == TPM_RETRY) {
+			spi_xfer->len = 1;
+			spi_xfer->cs_change = 0;
+			spi_message_init(&m);
+			spi_message_add_tail(spi_xfer, &m);
+			if (ret < 0)
+				return ret;
 			return -ETIMEDOUT;
+		}
 	}
 
 	return 0;
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout
@ 2020-01-14 12:31 wanghongzhe
  2020-01-14 12:12 ` Paul Menzel
  0 siblings, 1 reply; 9+ messages in thread
From: wanghongzhe @ 2020-01-14 12:31 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1, wanghongzhe

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@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout
@ 2020-01-14 12:31 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2020-01-14 12:31 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, Zhangchenfeng (EulerOS)

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: Wang Hongzhe <wanghongzhe@huawei.com>
---
 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


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH] tpm: tpm_tis_spi: set cs_change = 0 when timesout
@ 2020-01-14 12:12 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2020-01-14 12:12 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1

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@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] tpm:tpm_tis_spi: set cs_change = 0 when timesout
@ 2019-01-15  7:02 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2019-01-15  7:02 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1, wanghongzhe

From: Wang Hongzhe <wanghongzhe@huawei.com>

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: Wang Hongzhe <wanghongzhe@huawei.com>
---
 drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index d1754fd..27e57bf 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -66,8 +66,15 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
 				break;
 		}
 
-		if (i == TPM_RETRY)
+		if (i == TPM_RETRY) {
+			spi_xfer->len = 1;
+			spi_xfer->cs_change = 0;
+			spi_message_init(&m);
+			spi_message_add_tail(spi_xfer, &m);
+			if (ret < 0)
+				return ret;
 			return -ETIMEDOUT;
+		}
 	}
 
 	return 0;
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] tpm:tpm_tis_spi: set cs_change = 0 when timesout
@ 2019-01-15  6:59 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2019-01-15  6:59 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1, wanghongzhe

From: Wang Hongzhe <wanghongzhe@huawei.com>

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: Wang Hongzhe <wanghongzhe@huawei.com>
---
 drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index d1754fd..27e57bf 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -66,8 +66,15 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
 				break;
 		}
 
-		if (i == TPM_RETRY)
+		if (i == TPM_RETRY) {
+			spi_xfer->len = 1;
+			spi_xfer->cs_change = 0;
+			spi_message_init(&m);
+			spi_message_add_tail(spi_xfer, &m);
+			if (ret < 0)
+				return ret;
 			return -ETIMEDOUT;
+		}
 	}
 
 	return 0;
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] tpm:tpm_tis_spi: set cs_change = 0 when timesout
@ 2019-01-15  6:56 wanghongzhe
  0 siblings, 0 replies; 9+ messages in thread
From: wanghongzhe @ 2019-01-15  6:56 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-integrity, linux-kernel, zhangchenfeng1, wanghongzhe

From: Wang Hongzhe <wanghongzhe@huawei.com>

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: Wang Hongzhe <wanghongzhe@huawei.com>
---
 drivers/char/tpm/tpm_tis_spi.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index d1754fd..27e57bf 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -66,8 +66,15 @@ static int tpm_tis_spi_flow_control(struct tpm_tis_spi_phy *phy,
 				break;
 		}
 
-		if (i == TPM_RETRY)
+		if (i == TPM_RETRY) {
+			spi_xfer->len = 1;
+			spi_xfer->cs_change = 0;
+			spi_message_init(&m);
+			spi_message_add_tail(spi_xfer, &m);
+			if (ret < 0)
+				return ret;
 			return -ETIMEDOUT;
+		}
 	}
 
 	return 0;
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-15  7:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1579071543-22632-1-git-send-email-wanghongzhe@huawei.com>
2020-01-15  6:31 ` [PATCH] tpm:tpm_tis_spi: set cs_change = 0 when timesout wanghongzhe
2020-01-15  7:09 wanghongzhe
  -- strict thread matches above, loose matches on Subject: below --
2020-01-14 12:31 [PATCH] tpm: tpm_tis_spi: " wanghongzhe
2020-01-14 12:12 ` Paul Menzel
2020-01-14 12:31 wanghongzhe
2020-01-14 12:12 wanghongzhe
2019-01-15  7:02 [PATCH] tpm:tpm_tis_spi: " wanghongzhe
2019-01-15  6:59 wanghongzhe
2019-01-15  6:56 wanghongzhe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).