linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] crypto: stm32/hash - Fix self test issue during export
@ 2019-04-08  7:41 Lionel Debieve
  2019-04-18 14:23 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Lionel Debieve @ 2019-04-08  7:41 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, Maxime Coquelin, Alexandre Torgue,
	linux-crypto, linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Fabien Dessenne, Ludovic Barre, linux-stm32

Change the wait condition to check if the hash is busy.
Context can be saved as soon as hash has finishing processing
data. Remove unused lock in the device structure.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/crypto/stm32/stm32-hash.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index 4a6cc8a..bfc49e6 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -181,8 +181,6 @@ struct stm32_hash_dev {
 	u32			dma_mode;
 	u32			dma_maxburst;
 
-	spinlock_t		lock; /* lock to protect queue */
-
 	struct ahash_request	*req;
 	struct crypto_engine	*engine;
 
@@ -977,7 +975,7 @@ static int stm32_hash_export(struct ahash_request *req, void *out)
 
 	pm_runtime_get_sync(hdev->dev);
 
-	while (!(stm32_hash_read(hdev, HASH_SR) & HASH_SR_DATA_INPUT_READY))
+	while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY))
 		cpu_relax();
 
 	rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER,
-- 
2.7.4


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

* Re: [PATCH 1/1] crypto: stm32/hash - Fix self test issue during export
  2019-04-08  7:41 [PATCH 1/1] crypto: stm32/hash - Fix self test issue during export Lionel Debieve
@ 2019-04-18 14:23 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2019-04-18 14:23 UTC (permalink / raw)
  To: Lionel Debieve
  Cc: David S . Miller, Maxime Coquelin, Alexandre Torgue,
	linux-crypto, linux-arm-kernel, linux-kernel, Benjamin Gaignard,
	Fabien Dessenne, Ludovic Barre, linux-stm32

On Mon, Apr 08, 2019 at 09:41:58AM +0200, Lionel Debieve wrote:
> Change the wait condition to check if the hash is busy.
> Context can be saved as soon as hash has finishing processing
> data. Remove unused lock in the device structure.
> 
> Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
> ---
>  drivers/crypto/stm32/stm32-hash.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2019-04-18 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-08  7:41 [PATCH 1/1] crypto: stm32/hash - Fix self test issue during export Lionel Debieve
2019-04-18 14:23 ` Herbert Xu

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).