diff mbox series

[7/7] crypto: axis - move request unmap outside of the queue lock

Message ID f2ecac9d188d1d7e1939951a758ff2ac448ad7c5.1548243646.git.larper@axis.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: axis - fixes for the Artpec SoCs | expand

Commit Message

Lars Persson Jan. 23, 2019, 11:59 a.m. UTC
From: Vincent Whitchurch <rabinv@axis.com>

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>
---
 drivers/crypto/axis/artpec6_crypto.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
index 71ef9ce68fd8..47b76cf2c764 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -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);
 	}