mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] media: uvcvideo: Fix race condition on metadata buffers
@ 2026-06-29 17:31 Ricardo Ribalda
  2026-06-29 17:31 ` [PATCH v2 1/2] media: uvcvideo: Fix race condition for meta buffer list Ricardo Ribalda
  2026-06-29 17:31 ` [PATCH v2 2/2] media: uvcvideo: Use wait queue for metadata streamoff Ricardo Ribalda
  0 siblings, 2 replies; 10+ messages in thread
From: Ricardo Ribalda @ 2026-06-29 17:31 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab,
	Guennadi Liakhovetski
  Cc: linux-media, linux-kernel, Ricardo Ribalda, stable

This series fixes a race condition when calling streamoff only on the
metada queue while streaming.

The first patch fixes the race condition and the second patch replaces a
busy wait with a waitqueue. It is probably overkilled and this is why it
is a follow-up patch.

Feel free to apply the first patch, both, or squash them into one patch.

Regards!!

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v2:
- Use a new flag in_flight to avoid keeping the spinlock for long
  periods of time
- Link to v1: https://lore.kernel.org/r/20250714-uvc-racemeta-v1-1-360de2e15a9a@chromium.org

---
Ricardo Ribalda (2):
      media: uvcvideo: Fix race condition for meta buffer list
      media: uvcvideo: Use wait queue for metadata streamoff

 drivers/media/usb/uvc/uvc_queue.c | 11 +++++++++++
 drivers/media/usb/uvc/uvc_video.c | 32 +++++++++++++++++++++++++++++++-
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 3 files changed, 45 insertions(+), 1 deletion(-)
---
base-commit: 253355887a1ab0ac8f33b356c7c1140eee554d18
change-id: 20250714-uvc-racemeta-fee2e69bbfcd

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


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

end of thread, other threads:[~2026-07-08 15:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 17:31 [PATCH v2 0/2] media: uvcvideo: Fix race condition on metadata buffers Ricardo Ribalda
2026-06-29 17:31 ` [PATCH v2 1/2] media: uvcvideo: Fix race condition for meta buffer list Ricardo Ribalda
2026-06-30  9:46   ` Hans de Goede
2026-06-30 10:17     ` Ricardo Ribalda
2026-06-30 13:21       ` Hans de Goede
2026-06-30 14:10         ` Ricardo Ribalda
2026-07-01 15:30           ` Hans de Goede
2026-07-08 10:57             ` Ricardo Ribalda
2026-07-08 15:17               ` Ricardo Ribalda
2026-06-29 17:31 ` [PATCH v2 2/2] media: uvcvideo: Use wait queue for metadata streamoff Ricardo Ribalda

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

all inboxes | Powered by JetHome®