crypto: axis - move request unmap outside of the queue lock
authorVincent Whitchurch <rabinv@axis.com>
Wed, 23 Jan 2019 11:59:46 +0000 (12:59 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Feb 2019 06:42:04 +0000 (14:42 +0800)
The request unmap and bounce buffer copying is currently unnecessarily
done while holding the queue spin lock.

Signed-off-by: Lars Persson <larper@axis.com>
Signed-off-by: Vincent Whitchurch <rabinv@axis.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/axis/artpec6_crypto.c

index 109efab6a9df2849e70a7ef26928a2d0a547eab9..57e5dca3253f6492c8057a4af967458fe596661e 100644 (file)
@@ -2127,11 +2127,7 @@ static void artpec6_crypto_task(unsigned long data)
 
                list_move_tail(&req->list, &complete_done);
 
-               artpec6_crypto_dma_unmap_all(req);
-               artpec6_crypto_copy_bounce_buffers(req);
-
                ac->pending_count--;
-               artpec6_crypto_common_destroy(req);
        }
 
        artpec6_crypto_process_queue(ac, &complete_in_progress);
@@ -2142,6 +2138,10 @@ static void artpec6_crypto_task(unsigned long data)
         * to allow new request submissions from the callbacks.
         */
        list_for_each_entry_safe(req, n, &complete_done, list) {
+               artpec6_crypto_dma_unmap_all(req);
+               artpec6_crypto_copy_bounce_buffers(req);
+               artpec6_crypto_common_destroy(req);
+
                req->complete(req->req);
        }