Commit 4cdf101e authored by Gary R Hook's avatar Gary R Hook Committed by Herbert Xu

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: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a60496a0
...@@ -250,17 +250,20 @@ static int ccp5_do_cmd(struct ccp5_desc *desc, ...@@ -250,17 +250,20 @@ static int ccp5_do_cmd(struct ccp5_desc *desc,
ret = wait_event_interruptible(cmd_q->int_queue, ret = wait_event_interruptible(cmd_q->int_queue,
cmd_q->int_rcvd); cmd_q->int_rcvd);
if (ret || cmd_q->cmd_error) { if (ret || cmd_q->cmd_error) {
/* Log the error and flush the queue by
* moving the head pointer
*/
if (cmd_q->cmd_error) if (cmd_q->cmd_error)
ccp_log_error(cmd_q->ccp, ccp_log_error(cmd_q->ccp,
cmd_q->cmd_error); cmd_q->cmd_error);
/* A version 5 device doesn't use Job IDs... */ iowrite32(tail, cmd_q->reg_head_lo);
if (!ret) if (!ret)
ret = -EIO; ret = -EIO;
} }
cmd_q->int_rcvd = 0; cmd_q->int_rcvd = 0;
} }
return 0; return ret;
} }
static int ccp5_perform_aes(struct ccp_op *op) static int ccp5_perform_aes(struct ccp_op *op)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment