[Linux-stm32] [PATCH 5/7] crypto: stm32/hash: Wait for idle before final CPU xmit
Lionel DEBIEVE
lionel.debieve at foss.st.com
Tue Jan 3 08:22:53 UTC 2023
Acked-by: Lionel Debieve<lionel.debieve at foss.st.com>
On 12/28/22 00:03, Linus Walleij wrote:
> 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 mostlt worked fine, but when I used the
> extensive tests and stress the hardware I ran into this problem.
>
> Signed-off-by: Linus Walleij<linus.walleij at linaro.org>
> ---
> drivers/crypto/stm32/stm32-hash.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
> index 5f03be121787..92b2d55d6e93 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;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20230103/da5cb6af/attachment.html>
More information about the Linux-stm32
mailing list