mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 03:35:32 -04:00
crypto: rk3288 - fail ahash requests on HASH idle timeout
rk_hash_run() waits for RK_CRYPTO_HASH_STS to become idle after the
final DMA transfer, but ignores the poll result. If the hash engine
never becomes idle, the driver still reads the digest registers and
finalizes the request with the previous success value.
Store the poll result and finalize the request with the timeout error
before reading the digest registers.
Fixes: 37bc22159c ("crypto: rockchip - use read_poll_timeout")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -324,7 +324,12 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
|
||||
* efficiency, and make it response quickly when dma
|
||||
* complete.
|
||||
*/
|
||||
readl_poll_timeout(rkc->reg + RK_CRYPTO_HASH_STS, v, v == 0, 10, 1000);
|
||||
err = readl_poll_timeout(rkc->reg + RK_CRYPTO_HASH_STS, v,
|
||||
v == 0, 10, 1000);
|
||||
if (err) {
|
||||
dev_err(rkc->dev, "HASH idle timeout\n");
|
||||
goto theend;
|
||||
}
|
||||
|
||||
for (i = 0; i < crypto_ahash_digestsize(tfm) / 4; i++) {
|
||||
v = readl(rkc->reg + RK_CRYPTO_HASH_DOUT_0 + i * 4);
|
||||
|
||||
Reference in New Issue
Block a user