Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfd9b2aa authored by AnilKumar Chimata's avatar AnilKumar Chimata Committed by Gerrit - the friendly Code Review server
Browse files

crypto: msm: qcrypto: Close window during suspending for SMP



In the normal case, when a crypto operation is complete, driver process a
new request if there are any outstanding requests. In SMP, the suspending
may arrives in the window after driver completes the outstanding request,
and before driver starts a new operation. To close this window, a check
is added to make sure device is in BUS_HAS_BANDWIDTH to perform the next
operation.

Change-Id: Iccf73219dc55a5ad2af1f1d3a21f9a389db3d370
Signed-off-by: default avatarAnilKumar Chimata <anilc@codeaurora.org>
parent 0fc29b26
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1994,6 +1994,12 @@ again:

	backlog_eng = crypto_get_backlog(&pengine->req_queue);

	/* make sure it is in high bandwidth state */
	if (pengine->bw_state != BUS_HAS_BANDWIDTH) {
		spin_unlock_irqrestore(&cp->lock, flags);
		return 0;
	}

	/* try to get request from request queue of the engine first */
	async_req = crypto_dequeue_request(&pengine->req_queue);
	if (!async_req) {
@@ -4894,9 +4900,10 @@ err:

static int _qcrypto_engine_in_use(struct crypto_engine *pengine)
{
	if (pengine->req || pengine->req_queue.qlen)
	struct crypto_priv *cp = pengine->pcp;

	if (pengine->req || pengine->req_queue.qlen || cp->req_queue.qlen)
		return 1;
	else
	return 0;
}