Commit a88be9a7 authored by Lionel Debieve's avatar Lionel Debieve Committed by Herbert Xu

crypto: stm32/hash - Fix self test issue during export

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: default avatarLionel Debieve <lionel.debieve@st.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f1b70d16
...@@ -181,8 +181,6 @@ struct stm32_hash_dev { ...@@ -181,8 +181,6 @@ struct stm32_hash_dev {
u32 dma_mode; u32 dma_mode;
u32 dma_maxburst; u32 dma_maxburst;
spinlock_t lock; /* lock to protect queue */
struct ahash_request *req; struct ahash_request *req;
struct crypto_engine *engine; struct crypto_engine *engine;
...@@ -977,7 +975,7 @@ static int stm32_hash_export(struct ahash_request *req, void *out) ...@@ -977,7 +975,7 @@ static int stm32_hash_export(struct ahash_request *req, void *out)
pm_runtime_get_sync(hdev->dev); 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(); cpu_relax();
rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER, rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment