[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190828063716.22689-3-vic.wu@mediatek.com>
Date: Wed, 28 Aug 2019 14:37:14 +0800
From: Vic Wu <vic.wu@...iatek.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
CC: "David S . Miller" <davem@...emloft.net>,
Ryder Lee <ryder.lee@...iatek.com>,
<linux-crypto@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, Vic Wu <vic.wu@...iatek.com>
Subject: [PATCH 3/5] crypto: mediatek: only treat EBUSY as transient if backlog
From: Ryder Lee <ryder.lee@...iatek.com>
The driver was treating -EBUSY as indication of queueing to backlog
without checking that backlog is enabled for the request.
Fix it by checking request flags.
Signed-off-by: Ryder Lee <ryder.lee@...iatek.com>
Signed-off-by: Vic Wu <vic.wu@...iatek.com>
---
drivers/crypto/mediatek/mtk-sha.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c
index 2226f12d..1ecef3b5 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -781,7 +781,9 @@ static int mtk_sha_finup(struct ahash_request *req)
ctx->flags |= SHA_FLAGS_FINUP;
err1 = mtk_sha_update(req);
- if (err1 == -EINPROGRESS || err1 == -EBUSY)
+ if (err1 == -EINPROGRESS ||
+ (err1 == -EBUSY && (ahash_request_flags(req) &
+ CRYPTO_TFM_REQ_MAY_BACKLOG)))
return err1;
/*
* final() has to be always called to cleanup resources
--
2.17.1
Powered by blists - more mailing lists