crypto: inside-secure - acknowledge the result requests all at once
This patches moves the result request acknowledgment from a per request process to acknowledging all the result requests handled at once. Suggested-by: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
fc8c72b2cb
commit
2313e9f7ec
@ -600,7 +600,7 @@ static inline void safexcel_handle_result_descriptor(struct safexcel_crypto_priv
|
|||||||
{
|
{
|
||||||
struct safexcel_request *sreq;
|
struct safexcel_request *sreq;
|
||||||
struct safexcel_context *ctx;
|
struct safexcel_context *ctx;
|
||||||
int ret, i, nreq, ndesc = 0, done;
|
int ret, i, nreq, ndesc = 0, tot_descs = 0, done;
|
||||||
bool should_complete;
|
bool should_complete;
|
||||||
|
|
||||||
nreq = readl(priv->base + EIP197_HIA_RDR(ring) + EIP197_HIA_xDR_PROC_COUNT);
|
nreq = readl(priv->base + EIP197_HIA_RDR(ring) + EIP197_HIA_xDR_PROC_COUNT);
|
||||||
@ -622,13 +622,9 @@ static inline void safexcel_handle_result_descriptor(struct safexcel_crypto_priv
|
|||||||
if (ndesc < 0) {
|
if (ndesc < 0) {
|
||||||
kfree(sreq);
|
kfree(sreq);
|
||||||
dev_err(priv->dev, "failed to handle result (%d)", ndesc);
|
dev_err(priv->dev, "failed to handle result (%d)", ndesc);
|
||||||
goto requests_left;
|
goto acknowledge;
|
||||||
}
|
}
|
||||||
|
|
||||||
writel(EIP197_xDR_PROC_xD_PKT(1) |
|
|
||||||
EIP197_xDR_PROC_xD_COUNT(ndesc * priv->config.rd_offset),
|
|
||||||
priv->base + EIP197_HIA_RDR(ring) + EIP197_HIA_xDR_PROC_COUNT);
|
|
||||||
|
|
||||||
if (should_complete) {
|
if (should_complete) {
|
||||||
local_bh_disable();
|
local_bh_disable();
|
||||||
sreq->req->complete(sreq->req, ret);
|
sreq->req->complete(sreq->req, ret);
|
||||||
@ -636,6 +632,14 @@ static inline void safexcel_handle_result_descriptor(struct safexcel_crypto_priv
|
|||||||
}
|
}
|
||||||
|
|
||||||
kfree(sreq);
|
kfree(sreq);
|
||||||
|
tot_descs += ndesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
acknowledge:
|
||||||
|
if (i) {
|
||||||
|
writel(EIP197_xDR_PROC_xD_PKT(i) |
|
||||||
|
EIP197_xDR_PROC_xD_COUNT(tot_descs * priv->config.rd_offset),
|
||||||
|
priv->base + EIP197_HIA_RDR(ring) + EIP197_HIA_xDR_PROC_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
requests_left:
|
requests_left:
|
||||||
|
Reference in New Issue
Block a user