All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	Evgeniy Polyakov <zbr@ioremap.net>
Subject: [PATCH] Fix queue processing.
Date: Wed, 19 Nov 2008 17:03:31 +0300	[thread overview]
Message-ID: <12271034143351-git-send-email-zbr@ioremap.net> (raw)
In-Reply-To: <12271034142436-git-send-email-zbr@ioremap.net>

From: Patrick McHardy <kaber@trash.net>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
---
 drivers/crypto/hifn_795x.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 9a9e7ea..47952d8 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -2158,7 +2158,7 @@ static int hifn_setup_crypto_req(struct ablkcipher_request *req, u8 op,
 
 static int hifn_process_queue(struct hifn_device *dev)
 {
-	struct crypto_async_request *async_req;
+	struct crypto_async_request *async_req, *backlog;
 	struct hifn_context *ctx;
 	struct ablkcipher_request *req;
 	unsigned long flags;
@@ -2166,12 +2166,16 @@ static int hifn_process_queue(struct hifn_device *dev)
 
 	while (dev->started < HIFN_QUEUE_LENGTH) {
 		spin_lock_irqsave(&dev->lock, flags);
+		backlog = crypto_get_backlog(&dev->queue);
 		async_req = crypto_dequeue_request(&dev->queue);
 		spin_unlock_irqrestore(&dev->lock, flags);
 
 		if (!async_req)
 			break;
 
+		if (backlog)
+			backlog->complete(backlog, -EINPROGRESS);
+
 		ctx = crypto_tfm_ctx(async_req->tfm);
 		req = container_of(async_req, struct ablkcipher_request, base);
 
@@ -2575,6 +2579,9 @@ static void hifn_tasklet_callback(unsigned long data)
 	 * context or update is atomic (like setting dev->sa[i] to NULL).
 	 */
 	hifn_check_for_completion(dev, 0);
+
+	if (dev->started < HIFN_QUEUE_LENGTH &&	dev->queue.qlen)
+		hifn_process_queue(dev);
 }
 
 static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
-- 
1.5.2.5


  reply	other threads:[~2008-11-19 14:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19 14:03 [HIFN] Bugfix series Evgeniy Polyakov
2008-11-19 14:03 ` [PATCH] Move command descriptor setup to seperate function as preparation Evgeniy Polyakov
2008-11-19 14:03   ` [PATCH] Have HW invalidate src and dest descriptors after processing Evgeniy Polyakov
2008-11-19 14:03     ` [PATCH] Fix DMA setup Evgeniy Polyakov
2008-11-19 14:03       ` [PATCH] Don't copy src sg list Evgeniy Polyakov
2008-11-19 14:03         ` [PATCH] Fix request context corruption Evgeniy Polyakov
2008-11-19 14:03           ` Evgeniy Polyakov [this message]
2008-11-19 14:03             ` [PATCH] Remove some unused cruft Evgeniy Polyakov
2008-11-19 14:03               ` [PATCH] Fix queue management Evgeniy Polyakov
2008-11-20  2:26           ` [PATCH] short benchmarks Andreas Gerlich
2008-11-20 13:27             ` Herbert Xu
2008-11-20 14:25               ` Evgeniy Polyakov
2008-11-20 14:33                 ` Herbert Xu
2008-11-24 13:53     ` [PATCH] Have HW invalidate src and dest descriptors after processing Herbert Xu
2008-11-24 14:00       ` Patrick McHardy
2008-11-24 14:09         ` Herbert Xu
2008-11-24 14:23           ` Evgeniy Polyakov
2008-11-24 14:34             ` Herbert Xu
2008-11-24 14:53               ` Evgeniy Polyakov
2008-11-24 14:05 ` [HIFN] Bugfix series Herbert Xu
2008-11-24 14:52   ` [HIFN] Use softirq kernel mapping in bh context Evgeniy Polyakov
2008-11-25 15:17     ` 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=12271034143351-git-send-email-zbr@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kaber@trash.net \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.