Linux Media Controller development
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: "Ricardo Ribalda" <ribalda@chromium.org>,
	"Michaël Melchiore" <rohel01@gmail.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Sasha Levin" <sashal@kernel.org>,
	hansg@kernel.org, linux-media@vger.kernel.org
Subject: [PATCH AUTOSEL 6.16-6.12] media: uvcvideo: Add quirk for HP Webcam HD 2300
Date: Tue,  5 Aug 2025 09:08:53 -0400	[thread overview]
Message-ID: <20250805130945.471732-18-sashal@kernel.org> (raw)
In-Reply-To: <20250805130945.471732-1-sashal@kernel.org>

From: Ricardo Ribalda <ribalda@chromium.org>

[ Upstream commit 53b0b80e5240fec7c5a420bffb310edc83faf4fd ]

HP Webcam HD 2300 does not seem to flip the FID bit according to spec.

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 [unknown]
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x03f0 HP, Inc
  idProduct          0xe207 HP Webcam HD 2300
  bcdDevice           10.20
  iManufacturer           3 Hewlett Packard
  iProduct                1 HP Webcam HD 2300
  iSerial                 0
  bNumConfigurations      1

Reported-by: Michaël Melchiore <rohel01@gmail.com>
Closes: https://lore.kernel.org/linux-media/CA+q66aRvTigH15cUyfvzPJ2mfsDFMt=CjuYNwvAZb29w8b1KDA@mail.gmail.com
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20250602-uvc-hp-quirk-v1-1-7047d94d679f@chromium.org
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

**Backport Status: YES**

This commit should be backported to stable kernel trees. Here's my
extensive analysis:

## 1. Nature of the Fix
This commit adds a hardware quirk for the HP Webcam HD 2300 (vendor ID
0x03f0, product ID 0xe207) to work around a hardware bug where the
device doesn't properly flip the FID (Frame ID) bit according to the UVC
specification. The quirk `UVC_QUIRK_STREAM_NO_FID` is applied to this
specific device.

## 2. Bug Impact on Users
Without this quirk, the HP Webcam HD 2300 will not function correctly
with the UVC driver. Based on the code analysis in `uvc_video.c`, the
FID bit is used for frame synchronization:
- When frames are out of sync, the driver drops payloads (lines
  2506-2509 in uvc_video.c)
- The EOF (End of Frame) detection relies on proper FID handling (lines
  2515-2518)

Without the quirk, users with this webcam would experience:
- Dropped frames
- Synchronization issues
- Non-functional or poorly functioning webcam

## 3. Minimal and Contained Change
The commit is extremely minimal - it only adds 9 lines to the
`uvc_ids[]` array in `uvc_driver.c`:
- Adds a single device entry with proper USB matching flags
- Associates the existing `uvc_quirk_stream_no_fid` structure with this
  device
- No new code logic, just a device ID table entry

## 4. Low Risk of Regression
This change has virtually zero risk of regression because:
- It only affects the specific HP Webcam HD 2300 device (vendor 0x03f0,
  product 0xe207)
- Uses an existing, well-tested quirk mechanism
  (`UVC_QUIRK_STREAM_NO_FID`)
- The quirk infrastructure is already present in stable kernels
- Similar quirks have been successfully backported before (as seen in
  the git log)

## 5. Follows Stable Tree Patterns
Looking at the commit history, similar device-specific quirk additions
have been regularly added:
- `8c54e58f94ed` - Add quirk for Actions UVC05
- `2762eab6d414` - Add Kurokesu C1 PRO camera
- `81f8c0e138c4` - Add quirk for Sonix Technology Co. 292a
- `b2ec92bb5605` - Add quirk for Kaiweets KTI-W02

These types of hardware enablement fixes are routinely backported to
stable kernels.

## 6. User-Reported Issue
The commit includes:
- `Reported-by: Michaël Melchiore`
- A `Closes:` tag linking to the original bug report
This indicates a real user encountered this problem and reported it,
making it a confirmed hardware compatibility issue affecting actual
users.

## Conclusion
This is an ideal candidate for stable backporting as it:
- Fixes a real hardware bug affecting users
- Is minimal and self-contained (9 lines added)
- Has zero risk of affecting other devices
- Enables proper functionality for HP Webcam HD 2300 users
- Follows established patterns for UVC driver quirk additions

 drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index da24a655ab68..bd875d35ec81 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2514,6 +2514,15 @@ static const struct uvc_device_info uvc_quirk_force_y8 = {
  * Sort these by vendor/product ID.
  */
 static const struct usb_device_id uvc_ids[] = {
+	/* HP Webcam HD 2300 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x03f0,
+	  .idProduct		= 0xe207,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= (kernel_ulong_t)&uvc_quirk_stream_no_fid },
 	/* Quanta ACER HD User Facing */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
-- 
2.39.5


  parent reply	other threads:[~2025-08-05 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250805130945.471732-1-sashal@kernel.org>
2025-08-05 13:08 ` [PATCH AUTOSEL 6.16-5.4] media: uvcvideo: Fix bandwidth issue for Alcor camera Sasha Levin
2025-08-05 13:08 ` [PATCH AUTOSEL 6.16] media: i2c: vd55g1: Fix RATE macros not being expressed in bps Sasha Levin
2025-08-05 13:08 ` [PATCH AUTOSEL 6.16-5.4] media: usb: hdpvr: disable zero-length read messages Sasha Levin
2025-08-05 13:08 ` Sasha Levin [this message]
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16] media: i2c: vd55g1: Setup sensor external clock before patching Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-6.15] media: iris: Add handling for corrupt and drop frames Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-5.4] media: tc358743: Check I2C succeeded during probe Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-5.4] media: tc358743: Return an appropriate colorspace from tc358743_set_fmt Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-5.4] media: tc358743: Increase FIFO trigger level to 374 Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-6.12] media: hi556: Fix reset GPIO timings Sasha Levin
2025-08-05 13:09 ` [PATCH AUTOSEL 6.16-6.15] media: uvcvideo: Set V4L2_CTRL_FLAG_DISABLED during queryctrl errors Sasha Levin

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=20250805130945.471732-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=hansg@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=ribalda@chromium.org \
    --cc=rohel01@gmail.com \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox