linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] media: vimc: release vimc in release cb of v4l2_device
@ 2019-11-26 12:08 Dafna Hirschfeld
  2019-11-26 12:08 ` [PATCH v3 1/3] media: vimc: replace vimc->pdev.dev with vimc->mdev.dev Dafna Hirschfeld
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dafna Hirschfeld @ 2019-11-26 12:08 UTC (permalink / raw)
  To: linux-media
  Cc: dafna.hirschfeld, hverkuil, dafna3, helen.koike, ezequiel, skhan, kernel

This patchset solves a crash that happens when unbinding the vimc
device while it is streaming. Currently when the device is unbounded
the vimc entities are released imidiettaly, this cause a crash
if the streaming thread or the capture device dereference them
after the release. The patchset solves this by deferring the release
to the release callback of v4l2_device. This ensures that
the vimc entities will be released after the last fh is closed
and so the streaming terminates before.

- The first patch replaces the usage of vimc_device.pdev.dev
with vimc.mdev.dev
- The second patch allocates the vimc_device dynamically.
This is needed since the release of the device is deferred
and might run after the device is initialized again.
- The third patch moves the release of the vimc_device
and all the vimc entities to the release callback of
v4l2_device.

Changes from v2:
in patch 3, in case of failure in the probe function the memory is released
directly from the probe function, and only on success path the release callback
of v4l2_device is assigned

Dafna Hirschfeld (3):
  media: vimc: replace vimc->pdev.dev with vimc->mdev.dev
  media: vimc: allocate vimc_device dynamically
  media: vimc: crash fix - release vimc in the v4l_device release

 drivers/media/platform/vimc/vimc-capture.c |  18 ++--
 drivers/media/platform/vimc/vimc-common.c  |   2 -
 drivers/media/platform/vimc/vimc-common.h  |  30 +++---
 drivers/media/platform/vimc/vimc-core.c    | 101 ++++++++++++++-------
 drivers/media/platform/vimc/vimc-debayer.c |  19 ++--
 drivers/media/platform/vimc/vimc-scaler.c  |  19 ++--
 drivers/media/platform/vimc/vimc-sensor.c  |  18 ++--
 7 files changed, 115 insertions(+), 92 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-26 19:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 12:08 [PATCH v3 0/3] media: vimc: release vimc in release cb of v4l2_device Dafna Hirschfeld
2019-11-26 12:08 ` [PATCH v3 1/3] media: vimc: replace vimc->pdev.dev with vimc->mdev.dev Dafna Hirschfeld
2019-11-26 12:08 ` [PATCH v3 2/3] media: vimc: allocate vimc_device dynamically Dafna Hirschfeld
2019-11-26 12:08 ` [PATCH v3 3/3] media: vimc: crash fix - release vimc in the v4l_device release Dafna Hirschfeld
2019-11-26 19:00 ` [PATCH v3 0/3] media: vimc: release vimc in release cb of v4l2_device Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).