aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/hifn_795x.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 97a77d7baca4..ce3a27ecfaa5 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,
2158 2158
2159static int hifn_process_queue(struct hifn_device *dev) 2159static int hifn_process_queue(struct hifn_device *dev)
2160{ 2160{
2161 struct crypto_async_request *async_req; 2161 struct crypto_async_request *async_req, *backlog;
2162 struct hifn_context *ctx; 2162 struct hifn_context *ctx;
2163 struct ablkcipher_request *req; 2163 struct ablkcipher_request *req;
2164 unsigned long flags; 2164 unsigned long flags;
@@ -2166,12 +2166,16 @@ static int hifn_process_queue(struct hifn_device *dev)
2166 2166
2167 while (dev->started < HIFN_QUEUE_LENGTH) { 2167 while (dev->started < HIFN_QUEUE_LENGTH) {
2168 spin_lock_irqsave(&dev->lock, flags); 2168 spin_lock_irqsave(&dev->lock, flags);
2169 backlog = crypto_get_backlog(&dev->queue);
2169 async_req = crypto_dequeue_request(&dev->queue); 2170 async_req = crypto_dequeue_request(&dev->queue);
2170 spin_unlock_irqrestore(&dev->lock, flags); 2171 spin_unlock_irqrestore(&dev->lock, flags);
2171 2172
2172 if (!async_req) 2173 if (!async_req)
2173 break; 2174 break;
2174 2175
2176 if (backlog)
2177 backlog->complete(backlog, -EINPROGRESS);
2178
2175 ctx = crypto_tfm_ctx(async_req->tfm); 2179 ctx = crypto_tfm_ctx(async_req->tfm);
2176 req = container_of(async_req, struct ablkcipher_request, base); 2180 req = container_of(async_req, struct ablkcipher_request, base);
2177 2181
@@ -2575,6 +2579,9 @@ static void hifn_tasklet_callback(unsigned long data)
2575 * context or update is atomic (like setting dev->sa[i] to NULL). 2579 * context or update is atomic (like setting dev->sa[i] to NULL).
2576 */ 2580 */
2577 hifn_check_for_completion(dev, 0); 2581 hifn_check_for_completion(dev, 0);
2582
2583 if (dev->started < HIFN_QUEUE_LENGTH && dev->queue.qlen)
2584 hifn_process_queue(dev);
2578} 2585}
2579 2586
2580static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) 2587static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)