]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: coda: do not skip finish_run if aborting
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 12 Dec 2019 14:02:52 +0000 (15:02 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Dec 2019 09:00:11 +0000 (10:00 +0100)
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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/coda/coda-bit.c
drivers/media/platform/coda/coda-common.c

index 00c7bed3dd57205e4a112c5d9e23048bcfb9fb52..5475de176ce367cb45c7719881503759de649047 100644 (file)
@@ -1629,6 +1629,9 @@ static void coda_finish_encode(struct coda_ctx *ctx)
        struct coda_dev *dev = ctx->dev;
        u32 wr_ptr, start_ptr;
 
+       if (ctx->aborting)
+               return;
+
        /*
         * 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
@@ -2266,6 +2269,9 @@ static void coda_finish_decode(struct coda_ctx *ctx)
        int err_vdoa = 0;
        u32 val;
 
+       if (ctx->aborting)
+               return;
+
        /* Update kfifo out pointer from coda bitstream read pointer */
        coda_kfifo_sync_from_device(ctx);
 
index 94fb4d2ecc439fc51bdf5dbf53abf6a8f4baa551..556f8e0f52d76607f90bd424e2c7ffd7e772806f 100644 (file)
@@ -1421,7 +1421,7 @@ static void coda_pic_run_work(struct work_struct *work)
 
                if (ctx->ops->run_timeout)
                        ctx->ops->run_timeout(ctx);
-       } else if (!ctx->aborting) {
+       } else {
                ctx->ops->finish_run(ctx);
        }