Skip to content

Commit a88be9a

Browse files
ldebieveherbertx
authored andcommitted
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: Lionel Debieve <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f1b70d1 commit a88be9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/crypto/stm32/stm32-hash.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ struct stm32_hash_dev {
181181
u32 dma_mode;
182182
u32 dma_maxburst;
183183

184-
spinlock_t lock; /* lock to protect queue */
185-
186184
struct ahash_request *req;
187185
struct crypto_engine *engine;
188186

@@ -977,7 +975,7 @@ static int stm32_hash_export(struct ahash_request *req, void *out)
977975

978976
pm_runtime_get_sync(hdev->dev);
979977

980-
while (!(stm32_hash_read(hdev, HASH_SR) & HASH_SR_DATA_INPUT_READY))
978+
while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY))
981979
cpu_relax();
982980

983981
rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER,

0 commit comments

Comments
 (0)