Commit ed4f92e3 authored by Patrick McHardy's avatar Patrick McHardy Committed by Herbert Xu

crypto: hifn_795x - Fix queue processing

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5df4c0c6
...@@ -2158,7 +2158,7 @@ static int hifn_setup_crypto_req(struct ablkcipher_request *req, u8 op, ...@@ -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) 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 hifn_context *ctx;
struct ablkcipher_request *req; struct ablkcipher_request *req;
unsigned long flags; unsigned long flags;
...@@ -2166,12 +2166,16 @@ static int hifn_process_queue(struct hifn_device *dev) ...@@ -2166,12 +2166,16 @@ static int hifn_process_queue(struct hifn_device *dev)
while (dev->started < HIFN_QUEUE_LENGTH) { while (dev->started < HIFN_QUEUE_LENGTH) {
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
backlog = crypto_get_backlog(&dev->queue);
async_req = crypto_dequeue_request(&dev->queue); async_req = crypto_dequeue_request(&dev->queue);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
if (!async_req) if (!async_req)
break; break;
if (backlog)
backlog->complete(backlog, -EINPROGRESS);
ctx = crypto_tfm_ctx(async_req->tfm); ctx = crypto_tfm_ctx(async_req->tfm);
req = container_of(async_req, struct ablkcipher_request, base); req = container_of(async_req, struct ablkcipher_request, base);
...@@ -2575,6 +2579,9 @@ static void hifn_tasklet_callback(unsigned long data) ...@@ -2575,6 +2579,9 @@ static void hifn_tasklet_callback(unsigned long data)
* context or update is atomic (like setting dev->sa[i] to NULL). * context or update is atomic (like setting dev->sa[i] to NULL).
*/ */
hifn_check_for_completion(dev, 0); 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) static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment