linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] crypto: ccree - fix retry handling in cc_send_sync_request()
@ 2020-01-28 19:09 Geert Uytterhoeven
  2020-01-29  9:11 ` Gilad Ben-Yossef
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-01-28 19:09 UTC (permalink / raw)
  To: Gilad Ben-Yossef
  Cc: Herbert Xu, David S . Miller, linux-crypto, linux-renesas-soc,
	linux-kernel, Geert Uytterhoeven

If cc_queues_status() indicates that the queue is full,
cc_send_sync_request() should loop and retry.

However, cc_queues_status() returns either 0 (for success), or -ENOSPC
(for queue full), while cc_send_sync_request() checks for real errors by
comparing with -EAGAIN.  Hence -ENOSPC is always considered a real
error, and the code never retries the operation.

Fix this by just removing the check, as cc_queues_status() never returns
any other error value than -ENOSPC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
I am not 100% sure what was intended originally.
Perhaps the second -ENOSPC error in cc_queues_status() should have been
-EAGAIN?
---
 drivers/crypto/ccree/cc_request_mgr.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
index 9d61e6f1247819e2..b2a18122f320b7b2 100644
--- a/drivers/crypto/ccree/cc_request_mgr.c
+++ b/drivers/crypto/ccree/cc_request_mgr.c
@@ -476,10 +476,6 @@ int cc_send_sync_request(struct cc_drvdata *drvdata,
 			break;
 
 		spin_unlock_bh(&mgr->hw_lock);
-		if (rc != -EAGAIN) {
-			cc_pm_put_suspend(dev);
-			return rc;
-		}
 		wait_for_completion_interruptible(&drvdata->hw_queue_avail);
 		reinit_completion(&drvdata->hw_queue_avail);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-29  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 19:09 [PATCH] [RFC] crypto: ccree - fix retry handling in cc_send_sync_request() Geert Uytterhoeven
2020-01-29  9:11 ` Gilad Ben-Yossef
2020-01-29  9:17   ` Gilad Ben-Yossef
2020-01-29  9:25   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).