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=CjuYNwvA... 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.o... 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,