]> git.openfabrics.org - ~emulex/infiniband.git/commit
[media] v4l2-mem2mem: clear m2m context from job_queue before ctx streamoff
authorShaik Ameer Basha <shaik.ameer@samsung.com>
Tue, 13 Aug 2013 05:58:07 +0000 (02:58 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 24 Aug 2013 07:04:41 +0000 (04:04 -0300)
commitfea564a5f6a4ed6d3241aa90714ae2f0894a768a
treec77981df3bfb51d2a9e63b0602bf810f14f9698d
parent976f375df1730dd16aa7c101298ec47bdd338d79
[media] v4l2-mem2mem: clear m2m context from job_queue before ctx streamoff

When streamoff is called on the context and the context
is added to the job_queue,
1] sometimes device_run receives the empty vb2 buffers (as
   v4l2_m2m_streamoff is dropping the ready queue).
2] sometimes v4l2_m2m_job_finish may not succeed as the m2m_dev->curr_ctx
   is made NULL in the v4l2_m2m_streamoff()
The above points may stop the execution of the other queued contexts.
This patch makes sure that before streamoff is executed on any context,
that context should "not be running" or "not queued" in the job_queue.
1] If the current context is running, then abort job will be called.
2] If the current context is queued, then the context will be removed from
   the job_queue.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-mem2mem.c