diff options
author | Ezequiel Garcia | 2018-10-18 20:02:23 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2018-11-23 12:37:47 +0100 |
commit | cbd9463da1b12cdf9aa79e7cf470431d39131fca (patch) | |
tree | cf8ef58c3ba7e2125e67f23bb2305d596e166cdc /drivers/media/media-request.c | |
parent | media: v4l2-mem2mem: Simplify exiting the function in __v4l2_m2m_try_schedule (diff) | |
download | kernel-qcow2-linux-cbd9463da1b12cdf9aa79e7cf470431d39131fca.tar.gz kernel-qcow2-linux-cbd9463da1b12cdf9aa79e7cf470431d39131fca.tar.xz kernel-qcow2-linux-cbd9463da1b12cdf9aa79e7cf470431d39131fca.zip |
media: v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish
v4l2_m2m_job_finish() is typically called when
DMA operations complete, in interrupt handlers or DMA
completion callbacks. Calling .device_run from v4l2_m2m_job_finish
creates a nasty re-entrancy path into the driver.
Moreover, some implementation of .device_run might need to sleep,
as is the case for drivers supporting the Request API,
where controls are applied via v4l2_ctrl_request_setup,
which takes the ctrl handler mutex.
This commit adds a deferred context that calls v4l2_m2m_try_run,
and gets scheduled by v4l2_m2m_job_finish().
Before this change, device_run would be called from these
paths:
vb2_m2m_request_queue, or
v4l2_m2m_streamon, or
v4l2_m2m_qbuf
v4l2_m2m_try_schedule
v4l2_m2m_try_run
.device_run
v4l2_m2m_job_finish
v4l2_m2m_try_run
.device_run
After this change, the latter is now gone and instead:
v4l2_m2m_device_run_work
v4l2_m2m_try_run
.device_run
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/media-request.c')
0 files changed, 0 insertions, 0 deletions