summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary R Hook <gary.hook@amd.com>2017-02-09 22:49:57 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2017-02-15 06:23:34 +0100
commit4cdf101ef444e47bc8869ef3e90396e828fd9b61 (patch)
treedbea4b6ab8c2f394e1299e06b49bd32caa285c29
parentcrypto: ccp - Change mode for detailed CCP init messages (diff)
downloadlinux-4cdf101ef444e47bc8869ef3e90396e828fd9b61.tar.xz
linux-4cdf101ef444e47bc8869ef3e90396e828fd9b61.zip
crypto: ccp - Update the command queue on errors
Move the command queue tail pointer when an error is detected. Always return the error. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/ccp/ccp-dev-v5.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index e0dfb6a05c48..41cc853f8569 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -250,17 +250,20 @@ static int ccp5_do_cmd(struct ccp5_desc *desc,
ret = wait_event_interruptible(cmd_q->int_queue,
cmd_q->int_rcvd);
if (ret || cmd_q->cmd_error) {
+ /* Log the error and flush the queue by
+ * moving the head pointer
+ */
if (cmd_q->cmd_error)
ccp_log_error(cmd_q->ccp,
cmd_q->cmd_error);
- /* A version 5 device doesn't use Job IDs... */
+ iowrite32(tail, cmd_q->reg_head_lo);
if (!ret)
ret = -EIO;
}
cmd_q->int_rcvd = 0;
}
- return 0;
+ return ret;
}
static int ccp5_perform_aes(struct ccp_op *op)