public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Vic Wu <vic.wu@mediatek•com>
To: Herbert Xu <herbert@gondor•apana.org.au>
Cc: Ryder Lee <ryder.lee@mediatek•com>,
	linux-kernel@vger•kernel.org, linux-mediatek@lists•infradead.org,
	linux-crypto@vger•kernel.org, Vic Wu <vic.wu@mediatek•com>,
	"David S . Miller" <davem@davemloft•net>,
	linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/5] crypto: mediatek: only treat EBUSY as transient if backlog
Date: Wed, 28 Aug 2019 14:37:14 +0800	[thread overview]
Message-ID: <20190828063716.22689-3-vic.wu@mediatek.com> (raw)
In-Reply-To: <20190828063716.22689-1-vic.wu@mediatek.com>

From: Ryder Lee <ryder.lee@mediatek•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@mediatek•com>
Signed-off-by: Vic Wu <vic.wu@mediatek•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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-08-28  6:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  6:37 [PATCH 1/5] crypto: mediatek: move mtk_aes_find_dev() to the right place Vic Wu
2019-08-28  6:37 ` [PATCH 2/5] crypto: mediatek: fix uninitialized value of gctx->textlen Vic Wu
2019-08-28  6:37 ` Vic Wu [this message]
2019-08-28  6:37 ` [PATCH 4/5] crypto: mediatek: add support to OFB/CFB mode Vic Wu
2019-08-28  6:37 ` [PATCH 5/5] crypto: mediatek: fix incorrect crypto key setting Vic Wu
2019-08-28  7:03   ` John Crispin
2019-09-05  4:52 ` [PATCH 1/5] crypto: mediatek: move mtk_aes_find_dev() to the right place Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190828063716.22689-3-vic.wu@mediatek.com \
    --to=vic.wu@mediatek$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=herbert@gondor$(echo .)apana.org.au \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-crypto@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mediatek@lists$(echo .)infradead.org \
    --cc=ryder.lee@mediatek$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox