* [PATCH 0/1] crypto: omap-sham backlog handling fix
@ 2010-12-29 9:58 Dmitry Kasatkin
2010-12-29 9:58 ` [PATCH 1/1] omap-sham: " Dmitry Kasatkin
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kasatkin @ 2010-12-29 9:58 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto, linux-omap
Hi,
Please take this important fix.
- Dmitry
Dmitry Kasatkin (1):
omap-sham: backlog handling fix
drivers/crypto/omap-sham.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] omap-sham: backlog handling fix
2010-12-29 9:58 [PATCH 0/1] crypto: omap-sham backlog handling fix Dmitry Kasatkin
@ 2010-12-29 9:58 ` Dmitry Kasatkin
2010-12-29 10:52 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Kasatkin @ 2010-12-29 9:58 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto, linux-omap
Previous commit "removed redundant locking" introduced
a bug in handling backlog.
In certain cases, when async request complete callback will
call complete() on -EINPROGRESS code, it will cause uncompleted requests.
It does not happen in implementation similar to crypto test manager,
but it will happen in implementation similar to dm-crypt.
Backlog needs to be checked before dequeuing next request.
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
---
drivers/crypto/omap-sham.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index eb988e7..2e71123 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -664,7 +664,7 @@ static void omap_sham_finish_req(struct ahash_request *req, int err)
static int omap_sham_handle_queue(struct omap_sham_dev *dd,
struct ahash_request *req)
{
- struct crypto_async_request *async_req, *backlog = 0;
+ struct crypto_async_request *async_req, *backlog;
struct omap_sham_reqctx *ctx;
struct ahash_request *prev_req;
unsigned long flags;
@@ -677,11 +677,10 @@ static int omap_sham_handle_queue(struct omap_sham_dev *dd,
spin_unlock_irqrestore(&dd->lock, flags);
return ret;
}
+ backlog = crypto_get_backlog(&dd->queue);
async_req = crypto_dequeue_request(&dd->queue);
- if (async_req) {
+ if (async_req)
dd->flags |= FLAGS_BUSY;
- backlog = crypto_get_backlog(&dd->queue);
- }
spin_unlock_irqrestore(&dd->lock, flags);
if (!async_req)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] omap-sham: backlog handling fix
2010-12-29 9:58 ` [PATCH 1/1] omap-sham: " Dmitry Kasatkin
@ 2010-12-29 10:52 ` Herbert Xu
0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2010-12-29 10:52 UTC (permalink / raw)
To: Dmitry Kasatkin; +Cc: linux-crypto, linux-omap
On Wed, Dec 29, 2010 at 11:58:28AM +0200, Dmitry Kasatkin wrote:
> Previous commit "removed redundant locking" introduced
> a bug in handling backlog.
> In certain cases, when async request complete callback will
> call complete() on -EINPROGRESS code, it will cause uncompleted requests.
> It does not happen in implementation similar to crypto test manager,
> but it will happen in implementation similar to dm-crypt.
> Backlog needs to be checked before dequeuing next request.
>
> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Patch applied. Thanks Dmitry.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-29 10:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-29 9:58 [PATCH 0/1] crypto: omap-sham backlog handling fix Dmitry Kasatkin
2010-12-29 9:58 ` [PATCH 1/1] omap-sham: " Dmitry Kasatkin
2010-12-29 10:52 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox