Commit eed569c4 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: do not skip finish_run if aborting

Always call finish_run when the hardware signals completion. This
will allow JPEG contexts to clean up even if job_abort was called
during the device_run.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent da090bf6
...@@ -1629,6 +1629,9 @@ static void coda_finish_encode(struct coda_ctx *ctx) ...@@ -1629,6 +1629,9 @@ static void coda_finish_encode(struct coda_ctx *ctx)
struct coda_dev *dev = ctx->dev; struct coda_dev *dev = ctx->dev;
u32 wr_ptr, start_ptr; u32 wr_ptr, start_ptr;
if (ctx->aborting)
return;
/* /*
* Lock to make sure that an encoder stop command running in parallel * Lock to make sure that an encoder stop command running in parallel
* will either already have marked src_buf as last, or it will wake up * will either already have marked src_buf as last, or it will wake up
...@@ -2266,6 +2269,9 @@ static void coda_finish_decode(struct coda_ctx *ctx) ...@@ -2266,6 +2269,9 @@ static void coda_finish_decode(struct coda_ctx *ctx)
int err_vdoa = 0; int err_vdoa = 0;
u32 val; u32 val;
if (ctx->aborting)
return;
/* Update kfifo out pointer from coda bitstream read pointer */ /* Update kfifo out pointer from coda bitstream read pointer */
coda_kfifo_sync_from_device(ctx); coda_kfifo_sync_from_device(ctx);
......
...@@ -1421,7 +1421,7 @@ static void coda_pic_run_work(struct work_struct *work) ...@@ -1421,7 +1421,7 @@ static void coda_pic_run_work(struct work_struct *work)
if (ctx->ops->run_timeout) if (ctx->ops->run_timeout)
ctx->ops->run_timeout(ctx); ctx->ops->run_timeout(ctx);
} else if (!ctx->aborting) { } else {
ctx->ops->finish_run(ctx); ctx->ops->finish_run(ctx);
} }
......
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