diff options
author | Antoine Ténart <antoine.tenart@free-electrons.com> | 2017-06-15 09:56:27 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-06-20 11:21:47 +0800 |
commit | 5eb0cc66f3a3cad46c2e432342f2a3c20c992b94 (patch) | |
tree | 24ccbdbafee8f430166511e4dd1cbc2ce3c9cc71 /drivers/crypto | |
parent | b1deb47ad10b71a7d62dfdb049735a1be2214eb2 (diff) | |
download | linux-stable-5eb0cc66f3a3cad46c2e432342f2a3c20c992b94.tar.gz linux-stable-5eb0cc66f3a3cad46c2e432342f2a3c20c992b94.tar.bz2 linux-stable-5eb0cc66f3a3cad46c2e432342f2a3c20c992b94.zip |
crypto: inside-secure - only dequeue when needed
This force the need_dequeue flag to be unset whenever the dequeue
function is called, to avoid calling it when it is not necessary.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/inside-secure/safexcel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index 8f195e031938..e7f87ac12685 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -429,6 +429,8 @@ void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring) struct safexcel_request *request; int ret, nreq = 0, cdesc = 0, rdesc = 0, commands, results; + priv->ring[ring].need_dequeue = false; + do { spin_lock_bh(&priv->ring[ring].queue_lock); backlog = crypto_get_backlog(&priv->ring[ring].queue); @@ -631,10 +633,8 @@ static void safexcel_handle_result_work(struct work_struct *work) safexcel_handle_result_descriptor(priv, data->ring); - if (priv->ring[data->ring].need_dequeue) { - priv->ring[data->ring].need_dequeue = false; + if (priv->ring[data->ring].need_dequeue) safexcel_dequeue(data->priv, data->ring); - } } struct safexcel_ring_irq_data { |