Commit 5a2d52b5 authored by Linus Walleij's avatar Linus Walleij Committed by Herbert Xu

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: default avatarLionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 727f083f
...@@ -362,6 +362,9 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev, ...@@ -362,6 +362,9 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev,
stm32_hash_write(hdev, HASH_DIN, buffer[count]); stm32_hash_write(hdev, HASH_DIN, buffer[count]);
if (final) { if (final) {
if (stm32_hash_wait_busy(hdev))
return -ETIMEDOUT;
stm32_hash_set_nblw(hdev, length); stm32_hash_set_nblw(hdev, length);
reg = stm32_hash_read(hdev, HASH_STR); reg = stm32_hash_read(hdev, HASH_STR);
reg |= HASH_STR_DCAL; reg |= HASH_STR_DCAL;
......
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