linux_dsm_epyc7002/drivers/media/v4l2-core
Ezequiel Garcia cbd9463da1 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>
2018-11-23 06:37:47 -05:00
..
Kconfig media: Remove depends on HAS_DMA in case of platform dependency 2018-05-28 16:17:08 -04:00
Makefile media: v4l2-core: get rid of videobuf-dvb 2018-05-04 10:57:31 -04:00
tuner-core.c media: v4l2-mc: get rid of global pad indexes 2018-09-17 13:16:19 -04:00
v4l2-async.c media: v4l2-core: cleanup coding style at V4L2 async/fwnode 2018-10-05 06:49:16 -04:00
v4l2-clk.c media: Convert to using %pOF instead of full_name 2017-08-20 08:20:20 -04:00
v4l2-common.c media: v4l: subdev: Add a function to set an I²C sub-device's name 2018-09-17 15:17:22 -04:00
v4l2-compat-ioctl32.c media: v4l2-compat-ioctl32.c: add missing documentation for a field 2018-09-24 09:50:06 -04:00
v4l2-ctrls.c media: v4l: fix uapi mpeg slice params definition 2018-11-06 05:07:53 -05:00
v4l2-dev.c media: vidioc_cropcap -> vidioc_g_pixelaspect 2018-11-20 13:57:21 -05:00
v4l2-device.c media updates for v4.20-rc1 2018-10-31 10:53:29 -07:00
v4l2-dv-timings.c media: hdmi.h: rename ADOBE_RGB to OPRGB and ADOBE_YCC to OPYCC 2018-09-24 09:28:41 -04:00
v4l2-event.c media: v4l: event: Add subscription to list before calling "add" operation 2018-11-06 07:07:40 -05:00
v4l2-fh.c media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 06:32:51 -04:00
v4l2-flash-led-class.c media: use strscpy() instead of strlcpy() 2018-09-11 13:32:17 -04:00
v4l2-fwnode.c media: v4l2-fwnode: cleanup functions that parse endpoints 2018-10-05 06:49:24 -04:00
v4l2-ioctl.c media: v4l2-ioctl.c: Simplify locking for m2m devices 2018-11-23 06:36:00 -05:00
v4l2-mc.c media: v4l2-mc: add print messages when media graph fails 2018-09-17 13:16:19 -04:00
v4l2-mem2mem.c media: v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finish 2018-11-23 06:37:47 -05:00
v4l2-subdev.c media updates for v4.20-rc1 2018-10-31 10:53:29 -07:00
v4l2-trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
videobuf-core.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
videobuf-dma-contig.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
videobuf-dma-sg.c treewide: Use array_size() in vzalloc() 2018-06-12 16:19:22 -07:00
videobuf-vmalloc.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00