Commit 727f083f authored by Linus Walleij's avatar Linus Walleij Committed by Herbert Xu
Browse files

crypto: stm32/hash - Use existing busy poll function



When exporting state we are waiting indefinitely in the same
was as the ordinary stm32_hash_wait_busy() poll-for-completion
function but without a timeout, which means we could hang in
an eternal loop. Fix this by waiting for completion like the
rest of the code.

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 2d27267b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -960,11 +960,13 @@ static int stm32_hash_export(struct ahash_request *req, void *out)
	struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx);
	u32 *preg;
	unsigned int i;
	int ret;

	pm_runtime_get_sync(hdev->dev);

	while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY))
		cpu_relax();
	ret = stm32_hash_wait_busy(hdev);
	if (ret)
		return ret;

	rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER,
					 sizeof(u32),