diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2023-01-25 03:23:09 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-02-03 07:54:55 +0300 |
commit | 5a2d52b54065c2aeb0012d050734ead78252215a (patch) | |
tree | 3fcc8fb8d28a9d376ad2616dd763fa5dca16bd90 /drivers/crypto/stm32/stm32-hash.c | |
parent | 727f083ff48ae94cd7422e42bb9513ab61160e8a (diff) | |
download | linux-5a2d52b54065c2aeb0012d050734ead78252215a.tar.xz |
crypto: stm32/hash - Wait for idle before final CPU xmit
When calculating the hash using the CPU, right before the final
hash calculation, heavy testing on Ux500 reveals that it is wise
to wait for the hardware to go idle before calculating the
final hash.
The default test vectors mostly worked fine, but when I used the
extensive tests and stress the hardware I ran into this problem.
Acked-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/stm32/stm32-hash.c')
-rw-r--r-- | drivers/crypto/stm32/stm32-hash.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index cc0a4e413a82..d4eefd8292ff 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -362,6 +362,9 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev, stm32_hash_write(hdev, HASH_DIN, buffer[count]); if (final) { + if (stm32_hash_wait_busy(hdev)) + return -ETIMEDOUT; + stm32_hash_set_nblw(hdev, length); reg = stm32_hash_read(hdev, HASH_STR); reg |= HASH_STR_DCAL; |