public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] media: uvcvideo: Fixes for frame sequence number
@ 2026-03-23  9:53 Ricardo Ribalda
  2026-03-23  9:53 ` [PATCH v5 1/2] media: uvcvideo: Fix sequence number when no EOF Ricardo Ribalda
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ricardo Ribalda @ 2026-03-23  9:53 UTC (permalink / raw)
  To: Laurent Pinchart, Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Yunke Cao, Ricardo Ribalda, stable

This series fixes a couple of corner cases where the frame sequence
number is not properly handled.

Please note that the first patch has not been tested in a camera
without EOF. To emulate it I have used this:

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index b66d701f2582d..097bed2f7845f 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1360,6 +1360,8 @@ static void uvc_video_decode_end(struct uvc_streaming *stream,
 {
        /* Mark the buffer as done if the EOF marker is set. */
        if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) {
+               printk(KERN_ERR "Ignoring EOF\n");
+               return;
                uvc_dbg(stream->dev, FRAME, "Frame complete (EOF found)\n");
                if (data[0] == len)
                        uvc_dbg(stream->dev, FRAME, "EOF in empty payload\n");

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v5 (Thanks Hans):
- Swap order of patches
- Remove duplicated conditions.
- Link to v4: https://lore.kernel.org/r/20260320-uvc-fid-v4-0-f24f168ca2f9@chromium.org

Changes in v4 (Thanks Hans):
- Fix 2/2 logic.
- Link to v3: https://lore.kernel.org/r/20260316-uvc-fid-v3-0-c793354469b5@chromium.org

Changes in v3:
- Fix typo in commit message.
- Add new patch
- Link to v2: https://lore.kernel.org/r/20260313-uvc-fid-v2-1-3f7a996d9047@chromium.org

Changes in v2 (Thanks Laurent):
- Improve commit message.
- Remove original timestamp and sequence assignment. It is not neeed
- Link to v1: https://lore.kernel.org/r/20260310-uvc-fid-v1-1-5e37dc3c7024@chromium.org

---
Ricardo Ribalda (2):
      media: uvcvideo: Fix sequence number when no EOF
      media: uvcvideo: Fix buffer sequence in frame gaps

 drivers/media/usb/uvc/uvc_video.c | 110 +++++++++++++++++++++-----------------
 1 file changed, 61 insertions(+), 49 deletions(-)
---
base-commit: a7da7fb57f2a787412da1a62292a17fa00fbfbdf
change-id: 20260310-uvc-fid-e1e55447b6f1

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


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

end of thread, other threads:[~2026-03-30 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23  9:53 [PATCH v5 0/2] media: uvcvideo: Fixes for frame sequence number Ricardo Ribalda
2026-03-23  9:53 ` [PATCH v5 1/2] media: uvcvideo: Fix sequence number when no EOF Ricardo Ribalda
2026-03-24  0:20   ` Laurent Pinchart
2026-03-24  7:23     ` Ricardo Ribalda
2026-03-30 15:17     ` Hans de Goede
2026-03-23  9:53 ` [PATCH v5 2/2] media: uvcvideo: Fix buffer sequence in frame gaps Ricardo Ribalda
2026-03-30 15:31   ` Hans de Goede
2026-03-30 15:34 ` [PATCH v5 0/2] media: uvcvideo: Fixes for frame sequence number Hans de Goede

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