All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Max Staudt <mstaudt@chromium.org>,
	Tomasz Figa <tfiga@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sean Paul <seanpaul@chromium.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v4 0/4] uvcvideo: Attempt N to land UVC race conditions fixes
Date: Wed, 27 Mar 2024 20:04:47 +0900	[thread overview]
Message-ID: <20240327110447.GD1041856@google.com> (raw)
In-Reply-To: <20240327-guenter-mini-v4-0-49955c198eae@chromium.org>

On (24/03/27 08:24), Ricardo Ribalda wrote:
> Back in 2020 Guenter published a set of patches to fix some race
> conditions in UVC:
> https://lore.kernel.org/all/20200917022547.198090-5-linux@roeck-us.net/
> 
> That kind of race conditions are not only seen in UVC, but are a common
> seen in almost all the kernel, so this is what it was decided back then
> that we should try to fix them at higher levels.
> 
> After that. A lot of video_is_registered() were added to the core:
> 
> ```
> ribalda@alco:~/work/linux$ git grep is_registered drivers/media/v4l2-core/
> drivers/media/v4l2-core/v4l2-compat-ioctl32.c:  if (!video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (video_is_registered(vdev)) {
> drivers/media/v4l2-core/v4l2-dev.c:             if (video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (!video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (vdev == NULL || !video_is_registered(vdev)) {
> drivers/media/v4l2-core/v4l2-dev.c:             if (video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-dev.c:     if (!vdev || !video_is_registered(vdev))
> drivers/media/v4l2-core/v4l2-ioctl.c:   if (!video_is_registered(vfd)) {
> drivers/media/v4l2-core/v4l2-subdev.c:  if (video_is_registered(vdev)) {
> ```
> 
> And recently Sakari is trying to land:
> https://lore.kernel.org/linux-media/20230201214535.347075-1-sakari.ailus@linux.intel.com/
> 
> Which will make obsolete a lot off (all?) of the video_is_registered() checks in
> Guenter's patches.
> 
> Besides those checks, there were some other valid races fixed in his
> patches.
> 
> This patchset tries to fix the races still present in our code.
> 
> Thanks!
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

      parent reply	other threads:[~2024-03-27 11:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  8:24 [PATCH v4 0/4] uvcvideo: Attempt N to land UVC race conditions fixes Ricardo Ribalda
2024-03-27  8:24 ` [PATCH v4 1/4] media: uvcvideo: stop stream during unregister Ricardo Ribalda
2024-05-28  7:55   ` Hans Verkuil
2024-06-06 10:04     ` Tomasz Figa
2024-06-06 11:57       ` Hans Verkuil
2024-06-12  3:25         ` Tomasz Figa
2024-06-06  9:57   ` Tomasz Figa
2024-06-16 23:58     ` Laurent Pinchart
2024-06-17  7:27       ` Hans Verkuil
2024-06-17  7:56         ` Sakari Ailus
2024-06-17  8:19           ` Hans Verkuil
2024-03-27  8:24 ` [PATCH v4 2/4] media: uvcvideo: Refactor the status irq API Ricardo Ribalda
2024-03-27  8:24 ` [PATCH v4 3/4] media: uvcvideo: Avoid race condition during unregister Ricardo Ribalda
2024-03-27  8:24 ` [PATCH v4 4/4] media: uvcvideo: Exit early if there is not int_urb Ricardo Ribalda
2024-03-27 11:04 ` Sergey Senozhatsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327110447.GD1041856@google.com \
    --to=senozhatsky@chromium.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mchehab@kernel.org \
    --cc=mstaudt@chromium.org \
    --cc=ribalda@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=seanpaul@chromium.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.