Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCHv2 0/6] media: em28xx: fix lifecycle issues
@ 2026-06-16 13:10 Hans Verkuil
  2026-06-16 13:10 ` [PATCHv2 1/6] media: core: v4l2-async.c: unreg subdev if asc_list is empty Hans Verkuil
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Hans Verkuil @ 2026-06-16 13:10 UTC (permalink / raw)
  To: linux-media; +Cc: Mauricio Faria de Oliveira, Sakari Ailus

The first patch fixes (I believe) a bug in v4l2-async that
was introduced back in 2013. Sakari, can you take a look at this?

The second patch switches the em28xx driver to use the v4l2_device
release callback, letting the v4l2 core do all the refcounting
until the last user is gone and it is safe to free all memory.

The third patch drops the 'users' counter and uses the internal
v4l2_fh counter instead. The fourth patch switches
video_unregister_device to vb2_video_unregister_device: this
ensures all streaming is stopped when the video device is unregistered.

The fifth patch fixes a use-after-freed, and the last patch correctly
gives the vb2 buffers back to the vb2 framework if start_streaming
fails.

This has all been tested on my em28xx device.

Regards,

	Hans

Hans Verkuil (6):
  media: core: v4l2-async.c: unreg subdev if asc_list is empty
  media: em28xx: use v4l2_device release callback
  media: em28xx: drop 'users' field
  media: em28xx: use vb2_video_unregister_device
  media: em28xx: dev_info->pr_info since dev has been freed
  media: em28xx: requeue buffers if start_streaming fails

 drivers/media/usb/em28xx/em28xx-cards.c |   2 +-
 drivers/media/usb/em28xx/em28xx-video.c | 114 +++++++++++++++---------
 drivers/media/usb/em28xx/em28xx.h       |   2 -
 drivers/media/v4l2-core/v4l2-async.c    |   4 +-
 4 files changed, 74 insertions(+), 48 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-06-16 15:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 13:10 [PATCHv2 0/6] media: em28xx: fix lifecycle issues Hans Verkuil
2026-06-16 13:10 ` [PATCHv2 1/6] media: core: v4l2-async.c: unreg subdev if asc_list is empty Hans Verkuil
2026-06-16 15:15   ` Sakari Ailus
2026-06-16 13:10 ` [PATCHv2 2/6] media: em28xx: use v4l2_device release callback Hans Verkuil
2026-06-16 13:10 ` [PATCHv2 3/6] media: em28xx: drop 'users' field Hans Verkuil
2026-06-16 13:10 ` [PATCHv2 4/6] media: em28xx: use vb2_video_unregister_device Hans Verkuil
2026-06-16 13:10 ` [PATCHv2 5/6] media: em28xx: dev_info->pr_info since dev has been freed Hans Verkuil
2026-06-16 13:10 ` [PATCHv2 6/6] media: em28xx: requeue buffers if start_streaming fails Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox