Skip to contentSkip to conversation

USB/UVC: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

PATCH Superseded JP Hein 4 participants 39 messages Mar 31 – Nov 16 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore

JP Hein

author
#0 lore raw

v5 cover USB/UVC: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has a well-documented failure mode that cascades into complete xHCI host controller death, disconnecting every USB device on the bus -- including keyboards and mice, requiring a hard reboot.

The device has two crash triggers:

1. LPM/autosuspend resume: Device enters LPM or autosuspend, fails to reinitialize on resume, producing EPIPE (-32) on UVC SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the host controller dead.

2. Rapid control transfers: sustained rapid UVC SET_CUR operations (hundreds over several seconds) overwhelm the firmware. The error-code query (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) amplifies the failure by sending a second transfer to the already-stalling device, pushing it into a full lockup and xHCI controller death.

This has been reported as Ubuntu Launchpad Bug #2061177, with reports across kernel versions 6.5 through 6.8.

This series adds three patches:

Patch 1: USB core -- USB_QUIRK_NO_LPM to prevent Link Power Management
transitions that destabilize the device firmware.

Patch 2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit
SET_CUR control transfers (50ms minimum interval) and skip the error-code query after EPIPE errors on affected devices.

Patch 3: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME to address both crash triggers.

Together, these keep the device in a stable active state, prevent rapid control transfer crashes, and avoid the power management transitions that trigger the firmware bug.

Testing on 6.17.0-19-generic (Ubuntu 24.04 HWE) with dynamic debug enabled and NO patches or workarounds applied:
- v4l2-ctl stress test (control transfers only): passes 50/50
- Starting a video call: triggers hc_died() via LPM disable failure during isochronous stream setup
- Stress test during active video call: firmware stalls at round 19, repeated endpoint stalls with -32 EPIPE

The 6.8 -> 6.17 xHCI error handling improvements help with control transfer recovery, but the firmware lockup during video streaming still cascades to hc_died(). The patches in this series prevent the firmware from reaching the lockup state in the first place.

Changes since v4:
- Dropped stable CC (new quirks, not regression fixes)
- Updated cover letter with 6.17 test results

Changes since v3:
- Regenerated patches against media-committers next branch to fix context mismatch (v3 was based on Ubuntu 6.8 source)

Tested on:
- Kernel: 6.17.0-19-generic (Ubuntu 24.04 HWE) and 6.8.0-106-generic
- Hardware: Intel Cannon Lake PCH xHCI (8086:a36d)
- Device: Razer Kiyo Pro (1532:0e05), firmware 1.5.0.1

Stress test, crash evidence, and debug logs:
https://github.com/jphein/kiyo-xhci-fix

JP Hein (3):
USB: core: add NO_LPM quirk for Razer Kiyo Pro webcam
media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware
media: uvcvideo: add quirks for Razer Kiyo Pro webcam

 drivers/media/usb/uvc/uvc_driver.c | 17 ++++++++++++++++
 drivers/media/usb/uvc/uvc_video.c  | 32 ++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 drivers/usb/core/quirks.c          |  2 ++
 4 files changed, 54 insertions(+)
author
#1 lore raw

PATCH v5 1/3 USB: core: add NO_LPM quirk for Razer Kiyo Pro webcam

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 UVC webcam whose firmware does not handle USB Link Power Management transitions reliably. When LPM is active, the device can enter a state where it fails to respond to control transfers, producing EPIPE (-32) errors on UVC probe control SET_CUR requests. In the worst case, the stalled endpoint triggers an xHCI stop-endpoint command that times out, causing the host controller to be declared dead and every USB device on the bus to be disconnected.

This has been reported as Ubuntu Launchpad Bug #2061177. The failure mode is:

1. UVC probe control SET_CUR returns -32 (EPIPE)
2. xHCI host not responding to stop endpoint command
3. xHCI host controller not responding, assume dead
4. All USB devices on the affected xHCI controller disconnect

Disabling LPM prevents the firmware from entering the problematic low- power states that precede the stall. This is the same approach used for other webcams with similar firmware issues (e.g., Logitech HD Webcam C270).

---
 drivers/usb/core/quirks.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/core/quirks.c +2 -0
index 9e7e49712..7c4038a1e 100644
@@ -480,6 +480,8 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* Razer - Razer Blade Keyboard */
 	{ USB_DEVICE(0x1532, 0x0116), .driver_info =
 			USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
+	/* Razer - Razer Kiyo Pro Webcam */
+	{ USB_DEVICE(0x1532, 0x0e05), .driver_info = USB_QUIRK_NO_LPM },
 
 	/* Lenovo ThinkPad OneLink+ Dock twin hub controllers (VIA Labs VL812) */
 	{ USB_DEVICE(0x17ef, 0x1018), .driver_info = USB_QUIRK_RESET_RESUME },
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH v5 2/3 media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to JP Hein

Some USB webcams have firmware that crashes when it receives rapid consecutive UVC control transfers (SET_CUR). The Razer Kiyo Pro (1532:0e05) is one such device -- after several hundred rapid control changes over a few seconds, the device stops responding entirely, triggering an xHCI stop-endpoint command timeout that causes the host controller to be declared dead, disconnecting every USB device on the bus.

The failure is amplified by the standard UVC error-code query: when a SET_CUR fails with EPIPE, the driver sends a second transfer (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) to read the UVC error code. On a device that is already stalling, this second transfer pushes the firmware into a full lockup.

Introduce UVC_QUIRK_CTRL_THROTTLE (0x00080000) to address both issues:

- Enforce a minimum 50ms interval between SET_CUR control transfers, preventing the rapid-fire pattern that overwhelms the firmware. 50ms allows up to 20 control changes per second, which is sufficient for interactive slider adjustments while keeping the device stable.

- Skip the UVC_VC_REQUEST_ERROR_CODE_CONTROL query after EPIPE errors on devices with this quirk. EPIPE is returned directly without the follow-up query that would amplify the failure.

The UVC control path is serialized by ctrl_mutex, so last_ctrl_set_jiffies does not require additional locking.

---
 drivers/media/usb/uvc/uvc_video.c | 32 +++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 35 insertions(+)
drivers/media/usb/uvc/uvc_video.c +32 -0
index 40c76c051..9f402f55e 100644
@@ -75,8 +75,30 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 	u8 error;
 	u8 tmp;
 
+	/*
+	 * Rate-limit SET_CUR operations for devices with fragile firmware.
+	 * The Razer Kiyo Pro locks up under sustained rapid SET_CUR
+	 * transfers (hundreds without delay), crashing the xHCI controller.
+	 */
+	if (query == UVC_SET_CUR &&
+	    (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)) {
+		unsigned long min_interval = msecs_to_jiffies(50);
+
+		if (dev->last_ctrl_set_jiffies &&
+		    time_before(jiffies,
+				dev->last_ctrl_set_jiffies + min_interval)) {
+			unsigned long elapsed = dev->last_ctrl_set_jiffies +
+						min_interval - jiffies;
+			msleep(jiffies_to_msecs(elapsed));
+		}
+	}
+
 	ret = __uvc_query_ctrl(dev, query, unit, intfnum, cs, data, size,
 				UVC_CTRL_CONTROL_TIMEOUT);
+
+	if (query == UVC_SET_CUR &&
+	    (dev->quirks & UVC_QUIRK_CTRL_THROTTLE))
+		dev->last_ctrl_set_jiffies = jiffies;
 	if (likely(ret == size))
 		return 0;
 
@@ -108,6 +130,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 		return ret < 0 ? ret : -EPIPE;
 	}
 
+	/*
+	 * Skip the error code query for devices that crash under load.
+	 * The standard error-code query (GET_CUR on
+	 * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+	 * a device that is already stalling, which can amplify the failure
+	 * into a full firmware lockup and xHCI controller death.
+	 */
+	if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+		return -EPIPE;
+
 	/* Reuse data[0] to request the error code. */
 	tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -0
index 8480d65ec..cafc71457 100644
@@ -81,6 +81,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF	0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF		0x00020000
 #define UVC_QUIRK_MSXU_META		0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE		0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED		0x00000001
@@ -579,6 +580,8 @@ struct uvc_device {
 	struct usb_interface *intf;
 	unsigned long warnings;
 	u32 quirks;
+	/* Control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+	unsigned long last_ctrl_set_jiffies;
 	int intfnum;
 	char name[32];
 
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi JP

Quoted 8 lines · JP Hein

Some USB webcams have firmware that crashes when it receives rapid consecutive UVC control transfers (SET_CUR). The Razer Kiyo Pro (1532:0e05) is one such device -- after several hundred rapid control changes over a few seconds, the device stops responding entirely, triggering an xHCI stop-endpoint command timeout that causes the host controller to be declared dead, disconnecting every USB device on the bus.

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Quoted 33 lines

The failure is amplified by the standard UVC error-code query: when a SET_CUR fails with EPIPE, the driver sends a second transfer (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) to read the UVC error code. On a device that is already stalling, this second transfer pushes the firmware into a full lockup.

Introduce UVC_QUIRK_CTRL_THROTTLE (0x00080000) to address both issues:

- Enforce a minimum 50ms interval between SET_CUR control transfers, preventing the rapid-fire pattern that overwhelms the firmware. 50ms allows up to 20 control changes per second, which is sufficient for interactive slider adjustments while keeping the device stable.

- Skip the UVC_VC_REQUEST_ERROR_CODE_CONTROL query after EPIPE errors on devices with this quirk. EPIPE is returned directly without the follow-up query that would amplify the failure.

The UVC control path is serialized by ctrl_mutex, so last_ctrl_set_jiffies does not require additional locking.

---
 drivers/media/usb/uvc/uvc_video.c | 32 +++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 35 insertions(+)
drivers/media/usb/uvc/uvc_video.c +0 -0
index 40c76c051..9f402f55e 100644

drivers/media/usb/uvc/uvc_video.c int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, · line 77

Quoted 3 lines
drivers/media/usb/uvc/uvc_video.c +0 -0
@@ -75,8 +75,30 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
        u8 error;
        u8 tmp;
 

Why don't do you do the rate-limit in __uvc_query_ctrl()?

Are you sure that you only have to limit UVC_SET_CUR?

Quoted 68 lines
drivers/media/usb/uvc/uvc_video.c +32 -0
+       /*
+        * Rate-limit SET_CUR operations for devices with fragile firmware.
+        * The Razer Kiyo Pro locks up under sustained rapid SET_CUR
+        * transfers (hundreds without delay), crashing the xHCI controller.
+        */
+       if (query == UVC_SET_CUR &&
+           (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)) {
+               unsigned long min_interval = msecs_to_jiffies(50);
+
+               if (dev->last_ctrl_set_jiffies &&
+                   time_before(jiffies,
+                               dev->last_ctrl_set_jiffies + min_interval)) {
+                       unsigned long elapsed = dev->last_ctrl_set_jiffies +
+                                               min_interval - jiffies;
+                       msleep(jiffies_to_msecs(elapsed));
+               }
+       }
+
        ret = __uvc_query_ctrl(dev, query, unit, intfnum, cs, data, size,
                                UVC_CTRL_CONTROL_TIMEOUT);
+
+       if (query == UVC_SET_CUR &&
+           (dev->quirks & UVC_QUIRK_CTRL_THROTTLE))
+               dev->last_ctrl_set_jiffies = jiffies;
        if (likely(ret == size))
                return 0;
 
@@ -108,6 +130,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
                return ret < 0 ? ret : -EPIPE;
        }
 
+       /*
+        * Skip the error code query for devices that crash under load.
+        * The standard error-code query (GET_CUR on
+        * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+        * a device that is already stalling, which can amplify the failure
+        * into a full firmware lockup and xHCI controller death.
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+               return -EPIPE;
+
        /* Reuse data[0] to request the error code. */
        tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -1
index 8480d65ec..cafc71457 100644
@@ -81,6 +81,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF   0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF         0x00020000
 #define UVC_QUIRK_MSXU_META            0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE                0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED                0x00000001
@@ -579,6 +580,8 @@ struct uvc_device {
        struct usb_interface *intf;
        unsigned long warnings;
        u32 quirks;
+       /* Control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+       unsigned long last_ctrl_set_jiffies;
        int intfnum;
        char name[32];
 
--

2.43.0

Signature · 1 line
Ricardo Ribalda

A message that is not in the archive (sent off-list or not yet received): CAD5VvzAu8+Qz7hEEBzuKvO11X=YD-wrtX3_Tk77g2Cq5rZZD0Q@mail.gmail.com

#5 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi Ricardo,

Quoted 4 lines · Ricardo Ribalda

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Agreed -- a single device shouldn't be able to take down the host. Alan Stern raised the same point and asked whether xhci-hcd should handle this. Michal Pecio noted that the stop-endpoint command timeout is a controller-side failure and asked for dynamic debug traces on newer kernels and non-Intel hardware.

I provided the 6.17 traces. The result: the stress test (control transfers only) now passes 50/50 thanks to xHCI error handling improvements between 6.8 and 6.17. But starting a video stream still triggers hc_died() -- the firmware fails to disable LPM during stream setup, the endpoint stalls, and the stop-endpoint command times out.

So there's an open question on the xHCI side about whether the controller could recover from stop-endpoint timeouts instead of killing the HC. The UVC quirks are defense-in-depth -- they prevent the firmware from reaching the failure state that triggers the timeout in the first place.

I'm also planning to test on additional Intel machines (and non-Intel if I can source one) to determine whether the stop-endpoint timeout is controller-specific, per Michal's request.

Quoted 1 line

Why don't do you do the rate-limit in __uvc_query_ctrl()?

Good point -- moved it there in v6. This covers all callers including uvc_set_video_ctrl() which bypasses uvc_query_ctrl() for probe/commit.

Quoted 1 line

Are you sure that you only have to limit UVC_SET_CUR?

I haven't been able to isolate the crash to a specific query direction -- our testing shows it's the sustained transfer rate that matters. v6 throttles all query types in __uvc_query_ctrl() to be safe.

v6 posted with these changes.

Thanks,
JP

Quoted 133 lines · Ricardo Ribalda
Quoted 131 lines

Hi JP

Quoted 8 lines · JP Hein

Some USB webcams have firmware that crashes when it receives rapid consecutive UVC control transfers (SET_CUR). The Razer Kiyo Pro (1532:0e05) is one such device -- after several hundred rapid control changes over a few seconds, the device stops responding entirely, triggering an xHCI stop-endpoint command timeout that causes the host controller to be declared dead, disconnecting every USB device on the bus.

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Quoted 33 lines

The failure is amplified by the standard UVC error-code query: when a SET_CUR fails with EPIPE, the driver sends a second transfer (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) to read the UVC error code. On a device that is already stalling, this second transfer pushes the firmware into a full lockup.

Introduce UVC_QUIRK_CTRL_THROTTLE (0x00080000) to address both issues:

- Enforce a minimum 50ms interval between SET_CUR control transfers, preventing the rapid-fire pattern that overwhelms the firmware. 50ms allows up to 20 control changes per second, which is sufficient for interactive slider adjustments while keeping the device stable.

- Skip the UVC_VC_REQUEST_ERROR_CODE_CONTROL query after EPIPE errors on devices with this quirk. EPIPE is returned directly without the follow-up query that would amplify the failure.

The UVC control path is serialized by ctrl_mutex, so last_ctrl_set_jiffies does not require additional locking.

---
 drivers/media/usb/uvc/uvc_video.c | 32 +++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 35 insertions(+)
drivers/media/usb/uvc/uvc_video.c +0 -0
index 40c76c051..9f402f55e 100644

drivers/media/usb/uvc/uvc_video.c int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, · line 77

Quoted 3 lines
drivers/media/usb/uvc/uvc_video.c +0 -0
@@ -75,8 +75,30 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
        u8 error;
        u8 tmp;
 

Why don't do you do the rate-limit in __uvc_query_ctrl()?

Are you sure that you only have to limit UVC_SET_CUR?

Quoted 66 lines
drivers/media/usb/uvc/uvc_video.c +32 -0
+       /*
+        * Rate-limit SET_CUR operations for devices with fragile firmware.
+        * The Razer Kiyo Pro locks up under sustained rapid SET_CUR
+        * transfers (hundreds without delay), crashing the xHCI controller.
+        */
+       if (query == UVC_SET_CUR &&
+           (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)) {
+               unsigned long min_interval = msecs_to_jiffies(50);
+
+               if (dev->last_ctrl_set_jiffies &&
+                   time_before(jiffies,
+                               dev->last_ctrl_set_jiffies + min_interval)) {
+                       unsigned long elapsed = dev->last_ctrl_set_jiffies +
+                                               min_interval - jiffies;
+                       msleep(jiffies_to_msecs(elapsed));
+               }
+       }
+
        ret = __uvc_query_ctrl(dev, query, unit, intfnum, cs, data, size,
                                UVC_CTRL_CONTROL_TIMEOUT);
+
+       if (query == UVC_SET_CUR &&
+           (dev->quirks & UVC_QUIRK_CTRL_THROTTLE))
+               dev->last_ctrl_set_jiffies = jiffies;
        if (likely(ret == size))
                return 0;
 
@@ -108,6 +130,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
                return ret < 0 ? ret : -EPIPE;
        }
 
+       /*
+        * Skip the error code query for devices that crash under load.
+        * The standard error-code query (GET_CUR on
+        * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+        * a device that is already stalling, which can amplify the failure
+        * into a full firmware lockup and xHCI controller death.
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+               return -EPIPE;
+
        /* Reuse data[0] to request the error code. */
        tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -1
index 8480d65ec..cafc71457 100644
@@ -81,6 +81,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF   0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF         0x00020000
 #define UVC_QUIRK_MSXU_META            0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE                0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED                0x00000001
@@ -579,6 +580,8 @@ struct uvc_device {
        struct usb_interface *intf;
        unsigned long warnings;
        u32 quirks;
+       /* Control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+       unsigned long last_ctrl_set_jiffies;
        int intfnum;
        char name[32];
 
--
Quoted 2 lines

2.43.0

--
Ricardo Ribalda

#6 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Ricardo Ribalda
Quoted 12 lines · Ricardo Ribalda

Hi JP

Quoted 8 lines · JP Hein

Some USB webcams have firmware that crashes when it receives rapid consecutive UVC control transfers (SET_CUR). The Razer Kiyo Pro (1532:0e05) is one such device -- after several hundred rapid control changes over a few seconds, the device stops responding entirely, triggering an xHCI stop-endpoint command timeout that causes the host controller to be declared dead, disconnecting every USB device on the bus.

Quoted 4 lines

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Sorry, I forgot about this bug. I will take a closer look at logs later today.

I see that there is a case which crashes the host controller, but without dynamic debug. It would be helpful if this can be reproduced with debug enabled.

In the future, please also make sure that there are no unrelated devices spamming dmesg, like "slot 17 ep 2" in those "stall" logs. Please find this device and disconnect it or unbind its driver.

The initial cause of all that may really be the device getting locked up for no good reason, but not 100% sure yet.

Regards,
Michal

#7 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi Michal,

Thanks for taking another look.

I will reproduce the hc_died() crash with dynamic debug enabled (xhci_hcd +p, usbcore +p) and with all unrelated USB devices disconnected so the logs are clean. The slot 17 stalls in the previous logs may have been from another device on the bus -- I will make sure only the Kiyo is connected for the next capture.

The crash that kills the controller happens when starting a video stream (LPM disable failure path). I can SSH in to grab dmesg live during the crash since the controller death only takes out USB, not the network.

Will follow up with the traces.

Thanks,
JP

Quoted 35 lines · Michal Pecio
Quoted 12 lines · Ricardo Ribalda

Hi JP

Quoted 8 lines · JP Hein

Some USB webcams have firmware that crashes when it receives rapid consecutive UVC control transfers (SET_CUR). The Razer Kiyo Pro (1532:0e05) is one such device -- after several hundred rapid control changes over a few seconds, the device stops responding entirely, triggering an xHCI stop-endpoint command timeout that causes the host controller to be declared dead, disconnecting every USB device on the bus.

Quoted 4 lines

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Sorry, I forgot about this bug. I will take a closer look at logs later today.

I see that there is a case which crashes the host controller, but without dynamic debug. It would be helpful if this can be reproduced with debug enabled.

In the future, please also make sure that there are no unrelated devices spamming dmesg, like "slot 17 ep 2" in those "stall" logs. Please find this device and disconnect it or unbind its driver.

The initial cause of all that may really be the device getting locked up for no good reason, but not 100% sure yet.

Regards,
Michal

#8 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Michal Pecio
Quoted 8 lines · Michal Pecio
Quoted 4 lines · Ricardo Ribalda

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Sorry, I forgot about this bug. I will take a closer look at logs later today.

lsusb -v of identical(?) device is found here:
http://linux-hardware.org/?probe=a1cd74d9ac&log=lsusb

And I'm looking at the logs here:
https://github.com/jphein/kiyo-xhci-fix/tree/main/kernel-patches/crash-evidence

crash-6.17-stock-stress-20260330.log
Empty file, not sure why included at all.

crash-6.17-video-call-20260330.log
No debug messages. At some point:

Mar 30 10:00:52 katana kernel: usb 2-3.4: disable of device-initiated U1 failed.
Mar 30 10:00:53 katana kernel: usb 2-3.4: Failed to set U2 timeout to 0x0,error code -110
Mar 30 10:00:53 katana kernel: uvcvideo 2-3.4:1.1: usb_set_interface Failed to disable LPM
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).

Not sure if the LPM thing is the cause or a symptom of general EP 0 disfunction, as seen in subsequent EPROTO errors.

Not sure why usb_set_interface() is called. Is this the start streaming case mentioned in some email? What was happening before?

stall-6.17-stock-no-workarounds-20260330.log
All sorts of repeating errors, including stall on EP1IN ("ep 2") which is supposedly isochronous and shouldn't. Clearly some broken state, not sure how things got there.

stall-6.17-stress-during-call-20260330.log
This is the most interesting one.

The first slightly unusual thing is repeated unlinks on EP5IN (int), not sure why uvcvideo would do that, possibly result of the stess test. I know that such pattern alone can break ASMedia host controllers for no reason I understand, though this one is Intel.

It's suspicious that wBytesPerInterval of the endpoint is 8, wMaxPacket is 64 and URBs are 16 bytes. Just in case, I attach a test patch which rises wBytesPerInterval to match wMaxPacketSize.

The first definite anomaly is Transaction Error on EP5IN:

Mar 30 16:59:16 katana kernel: xhci_hcd 0000:00:14.0: Transfer error for slot 18 ep 10 on endpoint
Mar 30 16:59:16 katana kernel: xhci_hcd 0000:00:14.0: Hard-reset ep 10, slot 18

Not sure why endpoint reset follows immediately without retries. The test patch also removes one potential reason. We might see whether the retries will fail, or if retrying until the transfer succeeds magically prevents the subsequent disaster. Perhaps the device gets unusually upset about sequence mismatch on this endpoint, which results from not clearing this halt condition properly (known problem).

Five seconds later two control URBs are unlinked:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 00000000122aa5e2, dev 3.1, ep 0x0, starting at offset 0x11e227b40
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: // Ding dong!
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 000000008a55bcd3, dev 3.1, ep 0x0, starting at offset 0x11e227b20
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Not queuing Stop Endpoint on slot 18 ep 0 in state 0x44

Probably timeout, i.e. things got stuck. Oddly, state 0x44 indicates that this control endpoint has previously halted - error or stall.

Higher layers notice that things are timing out:

Mar 30 16:59:21 katana kernel: usb 2-3.1: pipewire timed out on ep0out len=0/0
Mar 30 16:59:21 katana kernel: usb 2-3.1: disable of device-initiated U1 failed.
Mar 30 16:59:21 katana kernel: usb 2-3.1: ThreadPoolSingl timed out on ep0out len=0/1

Nothing works from now. At some point the parent hub reports disconnection and reconnection. Still nothing works.

---

Would it be possible to repeat this test with the patch below? It overrides the suspicious wBytesPerInterval and hopefully enables retries of this failed interrupt URB. We will see what happens.

xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 1d50c91afd7f..17d78b4e07bf 100644

drivers/usb/host/xhci-mem.c +4 -0
@@ -1464,6 +1464,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
 	mult = xhci_get_endpoint_mult(xhci, udev, ep);
 	max_packet = xhci_usb_endpoint_maxp(udev, ep);
 	max_burst = xhci_get_endpoint_max_burst(udev, ep);
+	if (interval && max_esit_payload < max_packet) {
+		xhci_err(xhci, "max_esit_payload %d -> %d\n", max_esit_payload, max_packet);
+		max_esit_payload = max_packet;
+	}
 	avg_trb_len = max_esit_payload;
 
 	/* FIXME dig Mult and streams info out of ep companion desc */
drivers/usb/host/xhci-ring.c +1 -0
index 98ef014c8dee..e5823650850a 100644
@@ -2544,6 +2544,7 @@ static void process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
 		td->status = 0;
 		break;
 	case COMP_SHORT_PACKET:
+		ep->err_count = 0;
 		td->status = 0;
 		break;
 	case COMP_STOPPED_SHORT_PACKET:
#9 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi Michal,

Thanks for the detailed analysis.

Quoted 2 lines

crash-6.17-stock-stress-20260330.log
Empty file, not sure why included at all.

Sorry about that -- removed.

Quoted 2 lines

Not sure why usb_set_interface() is called. Is this the start streaming case mentioned in some email? What was happening before?

Yes, this is the start-streaming path. The app (Google Meet via browser) opens the video device, which triggers usb_set_interface() to select the alt setting for the isochronous endpoint. The LPM disable failure happens during that transition.

Quoted 2 lines

It's suspicious that wBytesPerInterval of the endpoint is 8, wMaxPacket is 64 and URBs are 16 bytes.

Interesting find. I had not looked at the interrupt endpoint descriptors closely.

Quoted 1 line

Would it be possible to repeat this test with the patch below?

Absolutely. I will apply your patch, rebuild xhci-hcd, reproduce the crash with dynamic debug enabled (xhci_hcd +p, usbcore +p), only the Kiyo connected, and grab dmesg via SSH during the crash.

The CI bot flagged a dts-bindings failure on v6 but all code checks (compile, smatch, sparse, checkpatch) passed -- unrelated to the UVC patches.

Will follow up with traces.

Thanks,
JP

Quoted 118 lines · Michal Pecio
Quoted 8 lines · Michal Pecio
Quoted 4 lines · Ricardo Ribalda

A usb device shall not be able crash the whole USB host. I believe that you already captured some logs and the USB guys are looking into it. I'd really like to hear what they have to say after reviewing them.

Sorry, I forgot about this bug. I will take a closer look at logs later today.

lsusb -v of identical(?) device is found here:
http://linux-hardware.org/?probe=a1cd74d9ac&log=lsusb

And I'm looking at the logs here:
https://github.com/jphein/kiyo-xhci-fix/tree/main/kernel-patches/crash-evidence

crash-6.17-stock-stress-20260330.log
Empty file, not sure why included at all.

crash-6.17-video-call-20260330.log
No debug messages. At some point:

Mar 30 10:00:52 katana kernel: usb 2-3.4: disable of device-initiated U1 failed.
Mar 30 10:00:53 katana kernel: usb 2-3.4: Failed to set U2 timeout to 0x0,error code -110
Mar 30 10:00:53 katana kernel: uvcvideo 2-3.4:1.1: usb_set_interface Failed to disable LPM
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
Mar 30 10:00:54 katana kernel: usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).

Not sure if the LPM thing is the cause or a symptom of general EP 0 disfunction, as seen in subsequent EPROTO errors.

Not sure why usb_set_interface() is called. Is this the start streaming case mentioned in some email? What was happening before?

stall-6.17-stock-no-workarounds-20260330.log
All sorts of repeating errors, including stall on EP1IN ("ep 2") which is supposedly isochronous and shouldn't. Clearly some broken state, not sure how things got there.

stall-6.17-stress-during-call-20260330.log
This is the most interesting one.

The first slightly unusual thing is repeated unlinks on EP5IN (int), not sure why uvcvideo would do that, possibly result of the stess test. I know that such pattern alone can break ASMedia host controllers for no reason I understand, though this one is Intel.

It's suspicious that wBytesPerInterval of the endpoint is 8, wMaxPacket is 64 and URBs are 16 bytes. Just in case, I attach a test patch which rises wBytesPerInterval to match wMaxPacketSize.

The first definite anomaly is Transaction Error on EP5IN:

Mar 30 16:59:16 katana kernel: xhci_hcd 0000:00:14.0: Transfer error for slot 18 ep 10 on endpoint
Mar 30 16:59:16 katana kernel: xhci_hcd 0000:00:14.0: Hard-reset ep 10, slot 18

Not sure why endpoint reset follows immediately without retries. The test patch also removes one potential reason. We might see whether the retries will fail, or if retrying until the transfer succeeds magically prevents the subsequent disaster. Perhaps the device gets unusually upset about sequence mismatch on this endpoint, which results from not clearing this halt condition properly (known problem).

Five seconds later two control URBs are unlinked:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 00000000122aa5e2, dev 3.1, ep 0x0, starting at offset 0x11e227b40
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: // Ding dong!
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 000000008a55bcd3, dev 3.1, ep 0x0, starting at offset 0x11e227b20
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Not queuing Stop Endpoint on slot 18 ep 0 in state 0x44

Probably timeout, i.e. things got stuck. Oddly, state 0x44 indicates that this control endpoint has previously halted - error or stall.

Higher layers notice that things are timing out:

Mar 30 16:59:21 katana kernel: usb 2-3.1: pipewire timed out on ep0out len=0/0
Mar 30 16:59:21 katana kernel: usb 2-3.1: disable of device-initiated U1 failed.
Mar 30 16:59:21 katana kernel: usb 2-3.1: ThreadPoolSingl timed out on ep0out len=0/1

Nothing works from now. At some point the parent hub reports disconnection and reconnection. Still nothing works.

---

Would it be possible to repeat this test with the patch below? It overrides the suspicious wBytesPerInterval and hopefully enables retries of this failed interrupt URB. We will see what happens.

xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 1d50c91afd7f..17d78b4e07bf 100644

drivers/usb/host/xhci-mem.c +4 -0
@@ -1464,6 +1464,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
        mult = xhci_get_endpoint_mult(xhci, udev, ep);
        max_packet = xhci_usb_endpoint_maxp(udev, ep);
        max_burst = xhci_get_endpoint_max_burst(udev, ep);
+       if (interval && max_esit_payload < max_packet) {
+               xhci_err(xhci, "max_esit_payload %d -> %d\n", max_esit_payload, max_packet);
+               max_esit_payload = max_packet;
+       }
        avg_trb_len = max_esit_payload;
 
        /* FIXME dig Mult and streams info out of ep companion desc */
drivers/usb/host/xhci-ring.c +1 -0
index 98ef014c8dee..e5823650850a 100644
@@ -2544,6 +2544,7 @@ static void process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
                td->status = 0;
                break;
        case COMP_SHORT_PACKET:
+               ep->err_count = 0;
                td->status = 0;
                break;
        case COMP_STOPPED_SHORT_PACKET:
#10 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

One more thing -- you mentioned referencing an lsusb from linux-hardware.org for an "identical(?) device". Here is the actual lsusb -vv from our device, confirming the wBytesPerInterval mismatch you found.

EP5 IN (interrupt) from raw SS Endpoint Companion descriptor:

Endpoint Descriptor:

    bEndpointAddress     0x85  EP 5 IN
    bmAttributes            3  (Interrupt)
    wMaxPacketSize     0x0040  1x 64 bytes
    bInterval               8
  SS Endpoint Companion:
    bMaxBurst               0
    bmAttributes         0x00
    wBytesPerInterval       8

So wBytesPerInterval (8) is indeed 8x smaller than wMaxPacketSize (64), matching what you saw in the third-party listing.

Note that lsusb -vv does not decode wBytesPerInterval for this endpoint -- the value above was parsed from the raw descriptor bytes in sysfs. The full lsusb -vv (934 lines) is now in the repo:

https://github.com/jphein/kiyo-xhci-fix/blob/main/kernel-patches/crash-evidence/lsusb-vv-kiyo-pro.txt

I will follow up with the test results from your patch.

JP

#11 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Quoted 2 lines · Jeffrey Hein

So wBytesPerInterval (8) is indeed 8x smaller than wMaxPacketSize (64), matching what you saw in the third-party listing.

Technically it's a spec violation if a device claims 8 bytes but respons with a single packet larger than that to a 16 byte (or any other) URB. Though no problems were known to result until last month. It seems most host controllers ignore byte per interval on interrupt.

Quoted 3 lines

Note that lsusb -vv does not decode wBytesPerInterval for this endpoint -- the value above was parsed from the raw descriptor bytes in sysfs. The full lsusb -vv (934 lines) is now in the repo:

It does decode it, but you need the latest usbutils version 019.

And there should be no need for lsusb -vv, just lsusb -v. I think the output pasted into v6 patch was truncated.

Regards,
Michal

#12 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Michal Pecio
Quoted 5 lines · Michal Pecio

Five seconds later two control URBs are unlinked:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 00000000122aa5e2, dev 3.1, ep 0x0, starting at offset 0x11e227b40
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: // Ding dong!
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 000000008a55bcd3, dev 3.1, ep 0x0, starting at offset 0x11e227b20
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Not queuing Stop Endpoint on slot 18 ep 0 in state 0x44

log continues with:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x11e227b40 (dma) in stream 0 URB 00000000122aa5e2
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x11e227b20 (dma) in stream 0 URB 000000008a55bcd3
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x11e227b40, cycle 0

One theory could be that xHC control endpoint refuses to restart when its dequeue pointer is moved to a no-op TD like in this case (second cancelled URB).

xhci spec section 4.8.3 'Endpoint context state' additional Note states that:
"The Default Control Endpoint shall return to the Running state when the
Doorbell is rung for the next Setup Stage TD sent to the endpoint."

Here the dequeue pointer will still be on the no-op TRB after queuing a new control transfer after it. Not on a setup stage TRB

This can happen when we cancel two control URBs at the same time.
We turn the second URB TRBs starting at 0x11e227b40 into no-ops,
then move past the first URB TRBs starting at 0x11e227b20 to the second URB no-op TRB at 0x11e227b40.

It's possible that disabling LPM helps as it reduces the number of control transfers, so there is a much smaller risk of cancelling two control URBs in one go.

Thanks
Mathias

#13 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Quoted 5 lines · Mathias Nyman

One theory could be that xHC control endpoint refuses to restart when its dequeue pointer is moved to a no-op TD like in this case (second cancelled URB).

This can happen when we cancel two control URBs at the same time.

I tested Michal's xhci patch (max_esit_payload clamp + short packet err_count reset) on a custom 6.17.0 kernel. Two separate tests below.

Hardware: Intel Cannon Lake PCH xHCI (8086:a36d)
Device: Razer Kiyo Pro (1532:0e05), bcdDevice 8.21
Kernel: 6.17.0-xhci-test (vanilla 6.17 + Michal's patch)

max_esit_payload 8 -> 64 confirmed firing at boot for EP5IN.

Test 1: Michal's xhci patch + JP's UVC patches + NO_LPM
=========================================================
Active: usbcore.quirks=1532:0e05:k (NO_LPM), DKMS uvcvideo with UVC_QUIRK_CTRL_THROTTLE, Michal's xhci patch.

Result: HC died. The crash sequence from the full log:

1) 437 repeated Cancel/resubmit cycles on EP5 IN (ep 0x85, slot 5 ep 10) over ~7 minutes starting mid-call:

[15:18:58] Cancel URB 0000000028356cb5, dev 3.1, ep 0x85, starting
at offset 0x114a49080
[15:18:58] Stopped on Transfer TRB for slot 5 ep 10
... (437 cancel/resubmit cycles through 15:26:04)

This is the same "repeated unlinks on EP5IN" pattern you noted in the March 30 stall-6.17-stress-during-call log, Michal.

2) After the last ep 0x85 cancellation + endpoint reconfigure (add ep 0x81), ~994,000 spurious SHORT_PACKET events (comp_code 13) flooded the HC for ~5 minutes:

[15:26:04] add ep 0x81, slot id 5
[15:26:04] Successful Endpoint Configure command [15:26:04] Spurious event dma ..., comp_code 13 after 13 ... (~993,703 spurious events through 15:30:48)

3) Control transfers started timing out, with miss service interval errors on isochronous eps 2 and 4:

[15:30:48] Cancel URB ..., dev 3.1, ep 0x0
[15:30:53] Cancel URB ..., dev 3.1, ep 0x0 (5s stop-ep timeout) [15:30:53] ThreadPoolSingl timed out on ep0in len=0/2 [15:30:53] Failed to query (GET_CUR) UVC control 6 on unit 1: -110 [15:30:59] Cancel URB ..., dev 3.1, ep 0x0
[15:31:04] Command timeout, USBSTS: 0x00000000 [15:31:04] xHCI host controller not responding, assume dead

Full log (2.9MB gz, 1.06M lines):
https://github.com/jphein/kiyo-xhci-fix/blob/main/kernel-patches/crash-evidence/crash-6.17.0-xhci-test-20260410-152541.log.gz

Test 2: Michal's xhci patch ONLY (clean isolation)
====================================================
Active: ONLY Michal's xhci patch. No usbcore.quirks cmdline, stock uvcvideo (DKMS module disabled), LPM and autosuspend at defaults.

Result: HC survived.

Video call ran successfully. Then ran stress test (rapid v4l2-ctl control transfers -- focus, white balance, exposure, zoom, brightness cycling). Firmware locked at round ~23:

  [336.489500] usb 2-3.1: pipewire timed out on ep0out len=0/0
  [336.489503] usb 2-3.1: disable of device-initiated U1 failed.
  [336.489510] usb 2-3.1: v4l2-ctl timed out on ep0out len=0/8
  [336.504055] Transfer error for slot 36 ep 10 on endpoint
  ... (repeating timeout/error cycle every ~5s)

Device firmware was completely unresponsive, but the host controller survived. No hc_died(). The transfer errors were on ep 10 (EP5 IN, the endpoint Michal's patch targeted).

Full log (1.2MB gz):
https://github.com/jphein/kiyo-xhci-fix/blob/main/kernel-patches/crash-evidence/crash-6.17.0-xhci-test-20260410-154243.log.gz

Full dmesg:
https://github.com/jphein/kiyo-xhci-fix/blob/main/kernel-patches/crash-evidence/michal-only-stress-20260410.log

Summary
========
In both tests, EP5 IN (interrupt, wBytesPerInterval=8) was at the center of the problem. In Test 1, the repeated unlinks on EP5 IN led to a spurious event flood that eventually killed the HC. In Test 2, EP5 IN had transfer errors but the HC handled them without dying.

The key variable between the tests was the UVC throttle and NO_LPM, not Michal's xhci patch (which was active in both). I don't yet understand why the additional UVC-layer mitigations would make the HC outcome worse, not better. Different test conditions (stream teardown in Test 1 vs active streaming in Test 2) may explain it.

Michal, re: lsusb -- I built usbutils 019 from source and confirmed it decodes wBytesPerInterval natively:

      Endpoint Descriptor:
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               8
        bMaxBurst               0
        wBytesPerInterval       8

Full lsusb -v (usbutils 019, 927 lines):
https://github.com/jphein/kiyo-xhci-fix/blob/main/kernel-patches/crash-evidence/lsusb-v-kiyo-pro-usbutils019.txt

v7 patch 2/2 included lsusb -vv (934 lines). If lsusb -v is preferred I can swap it in a v8.

I have other Intel machines available for testing if you'd like to confirm this isn't Cannon Lake-specific. No AMD hardware currently.

JP

#14 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Quoted 18 lines · Jeffrey Hein

Test 1: Michal's xhci patch + JP's UVC patches + NO_LPM
=========================================================
Active: usbcore.quirks=1532:0e05:k (NO_LPM), DKMS uvcvideo with UVC_QUIRK_CTRL_THROTTLE, Michal's xhci patch.

Result: HC died. The crash sequence from the full log:

1) 437 repeated Cancel/resubmit cycles on EP5 IN (ep 0x85, slot 5 ep 10) over ~7 minutes starting mid-call:

[15:18:58] Cancel URB 0000000028356cb5, dev 3.1, ep 0x85, starting
at offset 0x114a49080
[15:18:58] Stopped on Transfer TRB for slot 5 ep 10
... (437 cancel/resubmit cycles through 15:26:04)

This is the same "repeated unlinks on EP5IN" pattern you noted in the March 30 stall-6.17-stress-during-call log, Michal.

Quoted 7 lines

2) After the last ep 0x85 cancellation + endpoint reconfigure (add ep 0x81), ~994,000 spurious SHORT_PACKET events (comp_code 13) flooded the HC for ~5 minutes:

[15:26:04] add ep 0x81, slot id 5
[15:26:04] Successful Endpoint Configure command [15:26:04] Spurious event dma ..., comp_code 13 after 13

That's not abnormal and it probably shouldn't be logged at all. I filtered out some of this noise from subsequent log snippets.

This is interesting because it shows the isochronous video endpoint being enabled and then stopped and removed shortly after:

[Fri Apr 10 15:26:04 2026] xhci_hcd 0000:00:14.0: add ep 0x81, slot id 5, new drop flags = 0x0, new add flags = 0x8
[Fri Apr 10 15:26:04 2026] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for udev 00000000921e7e25
[Fri Apr 10 15:26:04 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:26:04 2026] xhci_hcd 0000:00:14.0: Successful Endpoint Configure command
[Fri Apr 10 15:26:05 2026] xhci_hcd 0000:00:14.0: Cancel URB 0000000009b97440, dev 3.1, ep 0x81, starting at offset 0x2db0885f0
[Fri Apr 10 15:26:05 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:26:05 2026] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 5 ep 2
[...]
[Fri Apr 10 15:26:05 2026] xhci_hcd 0000:00:14.0: drop ep 0x81, slot id 5, new drop flags = 0x8, new add flags = 0x0

Then EP5IN submit/unlink cycles continue.
And video starts again:

[Fri Apr 10 15:26:09 2026] xhci_hcd 0000:00:14.0: add ep 0x81, slot id 5, new drop flags = 0x0, new add flags = 0x8
[Fri Apr 10 15:26:09 2026] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for udev 00000000921e7e25
[Fri Apr 10 15:26:09 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:26:09 2026] xhci_hcd 0000:00:14.0: Successful Endpoint Configure command

Transfer error followed by normal operation, seems harmless so far:

[Fri Apr 10 15:29:04 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 5 ep 2 on endpoint
[Fri Apr 10 15:29:04 2026] xhci_hcd 0000:00:14.0: Error mid isoc TD, wait for final completion event
[Fri Apr 10 15:29:04 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 5 ep 2 on endpoint
[Fri Apr 10 15:29:04 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fb7e0, comp_code 13 after 13

EP0 stall, not seen before. A bit suspicious, but video still runs:

[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x00000002db088de0, comp_code 13 after 13
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x00000002db088e10, comp_code 13 after 13
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Stalled endpoint for slot 5 ep 0
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Hard-reset ep 0, slot 5
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Ignoring reset ep completion code of 1
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x114a485c0 (dma) in stream 0 URB 000000000ffbecf4
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x114a485f0, cycle 0
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: xhci_giveback_invalidated_tds: Keep cancelled URB 000000000ffbecf4 TD as cancel_status is 2
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x00000002db088e40, comp_code 13 after 13
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Successful Set TR Deq Ptr cmd, deq = @114a485f0
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: Giveback cancelled URB 000000000ffbecf4 TD
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Giveback URB 000000000ffbecf4, len = 0, expected = 4, status = -32
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: All TDs cleared, ring doorbell
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x00000002db088e80, comp_code 13 after 13
[Fri Apr 10 15:30:26 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x00000002db088eb0, comp_code 13 after 13

EP0 timeout and unlink, video endpoint fails shortly after:

[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbe30, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbe60, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Cancel URB 0000000008ead041, dev 3.1, ep 0x0, starting at offset 0x114a48290
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 5 ep 0
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x114a48290 (dma) in stream 0 URB 0000000008ead041
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x114a482c0, cycle 0
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: xhci_giveback_invalidated_tds: Keep cancelled URB 0000000008ead041 TD as cancel_status is 2
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Successful Set TR Deq Ptr cmd, deq = @114a482c0
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: Giveback cancelled URB 0000000008ead041 TD
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Giveback URB 0000000008ead041, len = 2, expected = 2, status = -115
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: All TDs cleared, ring doorbell
[Fri Apr 10 15:30:48 2026] usb 2-3.1: ThreadPoolSingl timed out on ep0in len=2/2
[Fri Apr 10 15:30:48 2026] usb 2-3.1: Failed to query (GET_CUR) UVC control 6 on unit 1: -110 (exp. 2).
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbe90, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbec0, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbef0, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbf30, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x000000028c6fbf60, comp_code 13 after 13
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 5 ep 2 on endpoint
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Miss service interval error for slot 5 ep 2, set skip flag
[Fri Apr 10 15:30:48 2026] xhci_hcd 0000:00:14.0: Miss service interval error for slot 5 ep 2, set skip flag

Now things are properly broken. Next EP0 URB times out too:

[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Cancel URB 000000008f70ed5c, dev 3.1, ep 0x0, starting at offset 0x114a482c0
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x114a482f0, cycle 0
[...]
[Fri Apr 10 15:30:53 2026] usb 2-3.1: ThreadPoolSingl timed out on ep0in len=0/2
[Fri Apr 10 15:30:53 2026] usb 2-3.1: Failed to query (GET_CUR) UVC control 6 on unit 1: -110 (exp. 2).

Fololwed by Transaction Error on the next and subsequent ones:

[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 5 ep 0 on endpoint
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: TRB error 4, halted endpoint index = 0
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Hard-reset ep 0, slot 5
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Ignoring reset ep completion code of 1
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x114a482f0 (dma) in stream 0 URB 000000000ca6398c
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x114a48320, cycle 0
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: xhci_giveback_invalidated_tds: Keep cancelled URB 000000000ca6398c TD as cancel_status is 2
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Successful Set TR Deq Ptr cmd, deq = @114a48320
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: Giveback cancelled URB 000000000ca6398c TD
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: Giveback URB 000000000ca6398c, len = 0, expected = 2, status = -71
[Fri Apr 10 15:30:53 2026] xhci_hcd 0000:00:14.0: xhci_handle_cmd_set_deq: All TDs cleared, ring doorbell
[Fri Apr 10 15:30:53 2026] usb 2-3.1: Failed to query (GET_CUR) UVC control 6 on unit 1: -71 (exp. 2).

It seems the driver stopped resubmitting video URBs here and issued some control transfer. It timed out and unlinking crashed the HC.

[Fri Apr 10 15:30:54 2026] xhci_hcd 0000:00:14.0: Miss service interval error for slot 5 ep 2, set skip flag
[Fri Apr 10 15:30:54 2026] xhci_hcd 0000:00:14.0: Miss service interval error for slot 5 ep 2, set skip flag
[Fri Apr 10 15:30:54 2026] xhci_hcd 0000:00:14.0: Overrun event on slot 5 ep 2
[Fri Apr 10 15:30:54 2026] xhci_hcd 0000:00:14.0: Skipped one TD for slot 5 ep 2
[Fri Apr 10 15:30:59 2026] xhci_hcd 0000:00:14.0: Cancel URB 000000007f4f069a, dev 3.1, ep 0x0, starting at offset 0x114a48770
[Fri Apr 10 15:30:59 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:31:04 2026] xhci_hcd 0000:00:14.0: Command timeout, USBSTS: 0x00000000
[Fri Apr 10 15:31:04 2026] xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command

---

Question: can you kill it by starting some video application to set the camera up, closing it and then running this loop?

while :; do v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1; done

Regards,
Michal

#15 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Quoted 4 lines · Michal Pecio

Question: can you kill it by starting some video application to set the camera up, closing it and then running this loop?

while :; do v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1; done

Hi again,

Any chance you could try it? And also the attached test program:

cc -lusb-1.0 hammerint.c -o hammerint
sudo ./hammerint 1532 0e05 0 85

Initial arguments are VID:PID of the device, next is the number of an interface containing some interrupt endpoint and then the endpoint address (including 8_ if IN).

I tried with a variety of SuperSpeed devices (UVC, NICs, hubs) and this reliably breaks ASMedia HCs within seconds. If the same is the case on Intel then it's a bigger problem than just UVC.

The video streaming loop breaks even more controllers. I have some general idea how the streaming case could be dealt with, but not so much the interrupt one. Maybe rate limiting. I found that avoiding Set TR Dequeue to Link TRBs reduces failure rate, but not to zero.

Long ago I also looked at the issued command sequences and I haven't noticed obvious errors or spec violations. Looks like a HW bug.

Regards,
Michal

#include <stdio.h>
#include <stdlib.h>

#include <libusb-1.0/libusb.h>

void comp(struct libusb_transfer *t) {
	char c = t->status == LIBUSB_TRANSFER_CANCELLED ? '.' :
		t->status == LIBUSB_TRANSFER_COMPLETED ? ',' : '-';
	fputc(c, stdout);
	fflush(stdout);
}

int hammer(int vid, int pid, int ifc, int ep) {

	struct libusb_device_handle *d;
	struct libusb_transfer *t;
	char bufi[1024] = {0};
	char bufc[2];
	int r;

	r = libusb_init(NULL);
	t = libusb_alloc_transfer(0);
	if (r || !t)
		return 1;

	d = libusb_open_device_with_vid_pid(NULL, vid, pid);
	if (!d)
		return 2;

	libusb_detach_kernel_driver(d, ifc);
	r = libusb_claim_interface(d, ifc);
	if (r)
		return 3;

	libusb_fill_interrupt_transfer(t, d, ep, bufi, sizeof(bufi), comp, NULL, 0);

	for (;;) {
		/* GET_STATUS(DEVICE) */
		r = libusb_control_transfer(d, 0x80, 0, 0, 0, bufc, sizeof(bufc), 100);
		if (r != sizeof(bufc))
			return 4;

		r = libusb_submit_transfer(t);
		if (r)
			return 5;
		r = libusb_cancel_transfer(t);
		if (r)
			return 6;
		r = libusb_handle_events(NULL);
		if (r)
			return 7;
	}
}

int main (int argc, char **argv) {

	int vid, pid, ifc, ep;
	int r;

	if (argc != 5) {
		fprintf(stderr, "USAGE: %s vid pid ifc ep\n", argv[0]);
		return 1;
	}

	vid = strtol(argv[1], NULL, 16);
	pid = strtol(argv[2], NULL, 16);
	ifc = strtol(argv[3], NULL, 16);
	ep = strtol(argv[4], NULL, 16);

	r = hammer(vid, pid, ifc, ep);
	printf("%d\n", r);
}
#16 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi Michal,

Both tests done. Intel xHCI 0000:00:14.0 (8086:a36d, Cannon Lake), kernel 6.17.0-20-generic stock, stock uvcvideo. Two Razer Kiyo Pro units (1532:0e05, fw 8.21) on root ports 2-1 and 2-2.

hammerint (2026-04-29): 60s per Kiyo. Kiyo 2-1 logged 413,738 submit/cancel cycles on EP 0x85 IN; Kiyo 2-2 logged 416,350. Both timed out cleanly (rc 124 -- didn't kill the HC). Zero xhci_hc_died, zero "event condition 198", no command timeouts in dmesg.

Caveat: usbcore.quirks=1532:0e05:k was on the cmdline that boot. Hammerint runs the link at full throttle so it never gets idle enough to attempt LPM transitions -- NO_LPM should be inert here -- but I can re-run without quirks if you want a clean reading.

stream-mmap loop (2026-05-03): 300s per Kiyo, MJPG 1920x1080 @ 30fps, no quirks on cmdline. Kiyo 2-1: 134 open-fmt-stream-close cycles on /dev/video0. Kiyo 2-2: 92 on /dev/video2. Both clean, dmesg.post empty of fatal patterns.

So Intel survives both reproducers in the windows tested. Doesn't disprove your "looks like a HW bug" framing -- consistent with Intel's xHCI ring tolerating the cancel/resubmit pattern that kills ASMedia. The cascade path is silicon-dependent.

Note on scope: neither test exercises the rapid-SET_CUR pattern (settings spam during a video call) that triggers the firmware lockup in real-world use. That separate trigger does crash Intel -- stress-test-kiyo.sh hits hc_died around round ~25 on stock kernel -- and CTRL_THROTTLE in the patch series addresses it. So the patch series argument doesn't change.

Side note: the same v4l2-ctl focus_absolute reproducer is reported on Linux ARM (Pi), Windows, and macOS by another user (Razer Insider) -- supports the firmware-bug framing. Reffed in the v8 upstream report.

For v8: CTRL_THROTTLE addresses the trigger (rapid SET_CUR -> firmware lockup), not the xHCI-side cascade. The xHCI side is your territory.

Forensics: https://github.com/jphein/kiyo-xhci-fix (raw run output lives in gitignored results/ dirs locally; happy to send SUMMARY.log + dmesg dumps off-list if useful).

JP

Jeffrey Pine Hein
Just plain helpful.
jphein.com ☀️ techempower.org
(530) 798-4099

Quoted 32 lines · Michal Pecio
Quoted 4 lines · Michal Pecio

Question: can you kill it by starting some video application to set the camera up, closing it and then running this loop?

while :; do v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1; done

Hi again,

Any chance you could try it? And also the attached test program:

cc -lusb-1.0 hammerint.c -o hammerint
sudo ./hammerint 1532 0e05 0 85

Initial arguments are VID:PID of the device, next is the number of an interface containing some interrupt endpoint and then the endpoint address (including 8_ if IN).

I tried with a variety of SuperSpeed devices (UVC, NICs, hubs) and this reliably breaks ASMedia HCs within seconds. If the same is the case on Intel then it's a bigger problem than just UVC.

The video streaming loop breaks even more controllers. I have some general idea how the streaming case could be dealt with, but not so much the interrupt one. Maybe rate limiting. I found that avoiding Set TR Dequeue to Link TRBs reduces failure rate, but not to zero.

Long ago I also looked at the issued command sequences and I haven't noticed obvious errors or spec violations. Looks like a HW bug.

Regards,
Michal

author
#17 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Michal Pecio

Hi Michal,

Three updates: the stock reproduction I owed you, a correction to my own endpoint labeling that touches earlier mails, and what looks like a separate usb-core regression on 7.x that you (or Greg's list) should probably see.

--- 1. Stock-kernel reproduction, full usbmon (2026-08-25) ---

Ubuntu kernel 7.0.0-30 (upstream 7.0.12 uvcvideo), no out-of-tree module of any kind, camera on a 20-minute-old enumeration, video + microphone both streaming in a WebRTC call. The controller died mid-call. usbmon was running on the bus for the whole call (168MB, preserved).

Wire sequence, same two-phase lock I described on 06-13, now on stock:

t0 app stops the stream; video URBs unlink cleanly (last frame
completes status 0)
t0+1ms SET_INTERFACE alt0 (iface 1) submitted -- Phase 1
t0+5.16s still unanswered; driver unlinks it (-2)

            (06-13 measured 5.4s; 05-30 measured 5.1-5.5s. Same number.)

t0+5.16s COMMIT_CONTROL SET_CUR submitted -- Phase 2
... COMMIT never completes. dmesg shows the escalation:
"Timeout while waiting for evaluate context command" "Abort failed to stop command ring: -110"
"xHCI host controller not responding, assume dead" -> HC died
t0+23.6s everything on the bus reaps -108/-2; the hung COMMIT
error-completes and prints the familiar
"Failed to set UVC commit control : -110" post-mortem.

Through Phase 1 and Phase 2 the microphone's iso endpoint streamed healthily to within a few ms of HC death (sequence numbers advancing, status 0). Control plane dead, data plane flowing -- consistent with everything since 05-30.

Same afternoon, two more commit-control stalls on fresh enumerations were caught early by my userspace watchdog (camera-only port cycle, no HC death), also captured. So: the lock reproduces on stock, and -110/-32 remain "who reaped the hung COMMIT first", as before.

One honesty note on that day: the machine was concurrently in a CPU/memory saturation incident (order-9 allocation fallbacks in uvc_alloc_urb_buffers in the same window). I don't think it changes the mechanism -- the wire signature is identical to the June captures taken at normal load -- but the unusual event *frequency* that day shouldn't be read as clean data.

--- 2. Correction: EP 0x82 is the microphone, not video ---

I mislabeled an endpoint in my 06-06 and 06-13 mails and want it on the record straight. From the descriptors and the wire:

  0x81  iso, wMaxPacketSize 0x400, 32 packets/URB, ~1MB buffers  = VIDEO
  0x82  iso, wMaxPacketSize 0x0c4 (196), 1 packet/URB @1ms       = AUDIO

(196B payloads are plainly 48kHz S16 stereo PCM on the wire)
0x85 interrupt, the wBytesPerInterval 8-vs-64 descriptor case = STATUS

So in my earlier mails: the "healthy iso video streaming through the control stall" was the *microphone*; and the 06-06 "timeout: still 12 active urbs on EP #82" hang was the *microphone* endpoint, which also means the mic was in active use in that crash. The two-phase structure and ordering are unchanged (control plane leads, data follows), but any reasoning that leaned on "video specifically wedges" should be discarded -- in the 08-25 stock capture, video had already stopped cleanly before Phase 1, and audio was the surviving stream.

--- 3. EP5 on stock: still no flood ---

The 08-25 stock capture has EP 0x85 at 5 events total across the whole call -- every one a teardown artifact (2x ENOENT unlink, ESHUTDOWN at HC death). Zero short-packet completions. That closes the loop from 06-13:
the absence of an EP5 COMP_SHORT_PACKET flood is now demonstrated on stock as well, so hypothesis A (EP5 underallocation -> ring congestion) is out on both driver variants. The lock is (B): a device/controller reconfiguration hang independent of the EP5 descriptor bug.

--- 4. Separate finding: NO_LPM quirk not applied on 7.x ---

While investigating I found the merged quirk from patch 1 of my series (usb-core quirks table entry for 1532:0e05, USB_QUIRK_NO_LPM) does not take effect on the 7.0 kernels I can test:

- the entry is present in 7.0 sources (drivers/usb/core/quirks.c), and

    'k' still maps to USB_QUIRK_NO_LPM in the dynamic-quirk parser;
  - I additionally boot with usbcore.quirks=1532:0e05:k (verified live in
    /sys/module/usbcore/parameters/quirks);

- yet after every enumeration the device shows power/usb3_hardware_lpm_u1 = enabled, and the sysfs quirks attribute reads 0x10 only (the RESET quirk my udev rule adds) -- no 0x100.

So this camera -- quirked upstream precisely because LPM destabilises its firmware -- has been running with U1 active on every 7.x kernel here. I can't yet say whether that raised the lock's frequency (see the load caveat above), but a merged NO_LPM quirk silently not applying seems worth a report to linux-usb regardless of this camera; I intend to send one after bisecting whether it's the static table, the dynamic parser, or the application point in hub.c that regressed. If you've seen anything like this on 7.x I'd be glad of a pointer. As a stopgap I now call usb_disable_lpm() from a local uvcvideo build's probe for this device, and the device then holds u1/u2 disabled.

--- Still owed ---

Item 3 from my last mail (A/B on your 6.17-xhci-test branch) is still open, with a wrinkle: my stock baseline has moved to 7.0, so a 6.17 A/B would no longer be apples-to-apples. If you have (or want) a 7.x rebase of the test patch I'll run it; otherwise I can boot the old 6.17 pair and accept the version skew for the comparison.

Captures + analysis: https://github.com/jphein/kiyo-xhci-fix
crash-evidence/auto-captures/CRASH-20260825T212701Z-4events.txt.gz
(stock HC death, full call, 168MB raw / 34MB gz)
crash-evidence/auto-captures/CRASH-20260825T213016Z-*.gz, -213154Z-*.gz,
-220834Z-*.gz (same-day precursor stalls, incl. one on the local LPM-workaround build)
crash-evidence/2026-08-25-stock-hc-crash/ (watchdog dump + notes)

JP

#18 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi Michal, all,

A retraction of one claim in my 08-26 mail, a status, and a proposal for the series, so the thread does not carry a wrong report.

--- 1. Retracting "NO_LPM quirk not applied on 7.x" -- it was my own parameter ---

There is no usb-core regression. I had booted with usbcore.quirks=1532:0e05:k since 6.17, when the entry was not in-tree. usb_detect_quirks() XORs the dynamic list against the static table, and kernel-parameters.txt says so ("each letter will change the built-in quirk; setting it if it is clear and clearing it if it is set"). On 7.0, where patch 1 is built in, the same parameter clears it: 0x400 ^ 0x400 = 0, and the device shows quirks = 0x10 (the RESET bit my udev rule sets) with U1 enabled -- exactly what I reported as a regression. A second Kiyo Pro on a second machine (7.0.0-38, no parameter) reads quirks = 0x400 and has no usb3_hardware_lpm_* attributes at all. Dropping the parameter fixes it. Sorry for the noise; there will be no bisect and no separate linux-usb report.

Small correction to the same paragraph: I wrote "no 0x100". USB_QUIRK_NO_LPM is BIT(10) = 0x400; 0x100 is DEVICE_QUALIFIER. The conclusion stood, the bit was wrong.

Consequence for my data: from the 26.04 upgrade (Aug) until now, every 7.x data point I sent had U1 active at the usb-core level, with the driver-level usb_disable_lpm() stopgap covering from probe onward from 08-25.

--- 2. Status since 08-26 ---

- With LPM off at the driver level (08-25 on) and, since 10-31, refused at the hub-port level too (usb3_lpm_permit = 0 on every port), the host still
died: five HC deaths on 2026-09-24 alone, same two-phase signature (SET_INTERFACE hang -> COMMIT hang -> evaluate-context timeout -> command ring abort fails -> HC died). So LPM changes the frequency, not the mechanism; the lock is in the device's reconfiguration path.
- What has kept calls working in practice is never stopping the stream: an always-on OBS instance holds the camera open and applications read a v4l2loopback virtual camera, so stream stop/reconfigure never reaches the firmware. One stall under that setup was absorbed by a hub VBUS cycle with no visible interruption.
- The two cameras now sit on two hosts (Intel Cannon Lake 00:14.0 on the desktop; a Titan Ridge Thunderbolt xHCI on a laptop) with the same stack on both, so a remaining desktop-only failure isolates the host.

--- 3. The series ---

Given the above I do not think CTRL_THROTTLE (v8 2/3) is the right layer and I would rather withdraw it than leave it pending: the failure is sequence-dependent, not rate-dependent, and a control-path throttle cannot address a hung COMMIT. Unless you or Laurent see value in the device-table entry on its own (DISABLE_AUTOSUSPEND | NO_RESET_RESUME), please consider v8 2/3 withdrawn.

Still open from my side: the A/B on your xhci-test patch. Is there a 7.x rebase, or should I run the 6.17 pair with the version skew? Either way I can now run it on two controllers.

Captures, tooling and the self-check that would have caught the parameter:
https://github.com/jphein/kiyo-xhci-fix

JP

#19 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

Hi,

FYI, I had a *broken* Kiyo Pro available for a few days in October. Starting a stream or autosuspend made it stop working altogether, but it was responding to control requests normally until then. Under such conditions, your stress test script ran at a rate of 2-3 iterations per second for thousands of iterations without issues.

The only exception was ASMedia host controllers, where the script triggered a known HW bug related to repeated restarting of interrupt endpoints. Same bug is also triggered by toggling USB3 NICs up and down and on a different USB3 UVC camera, but only if I slow down its interrupt endpoint polling rate to match Kiyo Pro.

So I found no evidence of HW bugs in this specific broken Kiyo Pro under my limited testing, but I found that UVC triggers HC bugs.

I'm curious if you could check how this camera works on 7.3 and newer releases, because commit 7c0c31c66a7f solved most cases of the ASMedia interrupt bug - it was caused not just by any repeated restarting of the endpoint, but by repeated restarting while on a link TRB. It also solved crashes of VL805 on repeated USB3 isochronous restarts. Looks like some HW may not be handling No-Op and Link TRBs 100% right.

Quoted 5 lines

- What has kept calls working in practice is never stopping the
stream: an always-on OBS instance holds the camera open and applications read a v4l2loopback virtual camera, so stream stop/reconfigure never reaches the firmware. One stall under that setup was absorbed by a hub VBUS cycle with no visible interruption.

Well, that's possibly an HC bug triggered by stopping UVC streaming, like on VL805 but with different symptoms.

Quoted 4 lines

- The two cameras now sit on two hosts (Intel Cannon Lake 00:14.0 on the desktop; a Titan Ridge Thunderbolt xHCI on a laptop) with the same stack on both, so a remaining desktop-only failure isolates the host.

Not sure what you mean, is the Titan Ridge free of problems?

Quoted 2 lines

Still open from my side: the A/B on your xhci-test patch. Is there a 7.x rebase, or should I run the 6.17 pair with the version skew?

Are you referring to what I posted on April 9th? Both parts of that patch (fix soft retry after short transfers and override bogus wBytesPerInterval values) are now in mainline.

OTOH, you could try the patch below, which is not in mainline. It makes stopping UVC streams less stressful for buggy HCs and it worked for those VL806 crashes which seem to be solved in 7.3 now.

Regards,
Michal

---

drivers/media/usb/uvc/uvc_video.c +7 -1
index fc3536a4399f..bc03e4b205e2 100644
@@ -1901,7 +1901,13 @@ static void uvc_video_stop_transfer(struct uvc_streaming *stream,
 	 * will be prevented from resubmitting the URBs.
 	 */
 	for_each_uvc_urb(uvc_urb, stream)
-		usb_poison_urb(uvc_urb->urb);
+		usb_block_urb(uvc_urb->urb);
+
+	for_each_uvc_urb(uvc_urb, stream)
+		usb_unlink_urb(uvc_urb->urb);
+
+	for_each_uvc_urb(uvc_urb, stream)
+		usb_kill_urb(uvc_urb->urb);
 
 	flush_workqueue(stream->async_wq);
 
#20 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Jeffrey Hein
Quoted 8 lines · Jeffrey Hein

Test 2: Michal's xhci patch ONLY (clean isolation)
====================================================
Active: ONLY Michal's xhci patch. No usbcore.quirks cmdline, stock uvcvideo (DKMS module disabled), LPM and autosuspend at defaults.

Result: HC survived.

Video call ran successfully.

Something weird when video was being disabled:

[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000272e42200, comp_code 13 after 13
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000272e42230, comp_code 13 after 13
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Cancel URB 0000000052d839d8, dev 3.1, ep 0x81, starting at offset 0x272e42f00
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 36 ep 2
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x272e42f00 (dma) in stream 0 URB 0000000052d839d8
[...]
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: xhci_giveback_invalidated_tds: Giveback cancelled URB 0000000052d839d8 TD
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Cancel URB 00000000d8d84b58, dev 3.1, ep 0x81, starting at offset 0x260549210
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 36 ep 2 on endpoint
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 36 ep 2
[...]
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: drop ep 0x81, slot id 36, new drop flags = 0x8, new add flags = 0x0

Video started again, seemed to work for a while:

[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: add ep 0x81, slot id 36, new drop flags = 0x0, new add flags = 0x8
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for udev 00000000e40f0c43
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: Successful Endpoint Configure command
[Fri Apr 10 15:44:47 2026] usb 2-3.1: Hub-initiated U1 disabled due to long timeout 16800us
[Fri Apr 10 15:44:47 2026] usb 2-3.1: Hub-initiated U1 disabled due to long timeout 132us
[Fri Apr 10 15:44:47 2026] usb 2-3.1: Hub-initiated U1 disabled due to long timeout 1050us
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: Set up evaluate context for LPM MEL change.
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: // Ding dong!
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: Successful evaluate context command
[Fri Apr 10 15:44:47 2026] usb 2-3.1: Disable U2, ESIT shorter than exit latency
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000260549020, comp_code 13 after 13
[Fri Apr 10 15:44:47 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000260549050, comp_code 13 after 13

Until it broke, not sure what caused this. No EP5IN unlinks here.

[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000272e42690, comp_code 13 after 13
[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: Spurious event dma 0x0000000272e426d0, comp_code 13 after 13
[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: No Ping response error for slot 36 ep 2, Skip one Isoc TD
[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: No Ping response error for slot 36 ep 2, Skip one Isoc TD
[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: No Ping response error for slot 36 ep 2, Skip one Isoc TD

Then EP5IN also fails and is soft-retried, but it doesn't help. Control requests get EPROTO or ETIMEDOUT as usual.

[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 36 ep 10 on endpoint
[Fri Apr 10 15:45:09 2026] xhci_hcd 0000:00:14.0: Soft-reset ep 10, slot 36

Looks like the device is dead indeed, or the HC broke down and can't communiate with it.

#21 lore raw

Re: [PATCH v5 2/3] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile firmware

In reply to Mathias Nyman
Quoted 6 lines · Mathias Nyman
Quoted 5 lines

Five seconds later two control URBs are unlinked:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 00000000122aa5e2, dev 3.1, ep 0x0, starting at offset 0x11e227b40
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: // Ding dong!
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Cancel URB 000000008a55bcd3, dev 3.1, ep 0x0, starting at offset 0x11e227b20
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Not queuing Stop Endpoint on slot 18 ep 0 in state 0x44  
Quoted 8 lines

log continues with:

Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x11e227b40 (dma) in stream 0 URB 00000000122aa5e2
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0x11e227b20 (dma) in stream 0 URB 000000008a55bcd3
Mar 30 16:59:21 katana kernel: xhci_hcd 0000:00:14.0: Set TR Deq ptr 0x11e227b40, cycle 0

One theory could be that xHC control endpoint refuses to restart when its dequeue pointer is moved to a no-op TD like in this case (second cancelled URB).

This could explain why it doesn't work later, but not why these URBs have been unlinked after making no progress for 5 seconds. EP0 was probably still functioning normally during those submit-unlink cycles on 0x85 and there were no EP0 unlinks until these above.

Another corner case which could potentially confuse HCs is Set TR Deq to a Link TRB, but it doesn't occur in this log on any endpoint.

By the way, are you able to find out what this is?
198 falls into the "vendor defined error" range and vendor is Intel.

crash-6.17.0-xhci-test-20260410-154243.log, isochronous URB unlink:

[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Transfer error for slot 36 ep 2 on endpoint
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: ERROR Unknown event condition 198 for slot 36 ep 2 , HC probably busted
[Fri Apr 10 15:44:31 2026] xhci_hcd 0000:00:14.0: Stopped on Transfer TRB for slot 36 ep 2
author
#22 lore raw

PATCH v5 3/3 media: uvcvideo: add quirks for Razer Kiyo Pro webcam

In reply to JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has two failure modes that cascade into full xHCI host controller death, disconnecting every USB device on the bus:

1. LPM/autosuspend resume: the device fails to reinitialize its UVC endpoints on resume, producing EPIPE on SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout.

2. Rapid control transfers: sustained rapid SET_CUR operations (hundreds over several seconds) overwhelm the firmware.

Add the device to the UVC driver table with:

- UVC_QUIRK_CTRL_THROTTLE: rate-limit SET_CUR (50ms interval) and skip error-code queries after EPIPE to prevent crash trigger #2.

- UVC_QUIRK_DISABLE_AUTOSUSPEND: prevent USB autosuspend transitions that trigger crash #1. Same approach as Insta360 Link.

- UVC_QUIRK_NO_RESET_RESUME: avoid the fragile reset-during-resume path. Same approach as Logitech Rally Bar.

---
 drivers/media/usb/uvc/uvc_driver.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +17 -0
index b0ca81d92..e8b4de942 100644
@@ -2920,6 +2920,23 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+	/*
+	 * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+	 * and on LPM/autosuspend resume, cascading into xHCI controller
+	 * death that disconnects all USB devices on the bus.
+	 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x1532,
+	  .idProduct		= 0x0e05,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+					| UVC_QUIRK_DISABLE_AUTOSUSPEND
+					| UVC_QUIRK_NO_RESET_RESUME) },
+
 	/* Kurokesu C1 PRO */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0
#23 lore raw

Re: [PATCH v5 3/3] media: uvcvideo: add quirks for Razer Kiyo Pro webcam

Hi JP

When we add a quirk to the list we include the output of lsusb -v -d 1532: to the commit message. Please add it to your next version.

Thanks!

Quoted 61 lines · JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has two failure modes that cascade into full xHCI host controller death, disconnecting every USB device on the bus:

1. LPM/autosuspend resume: the device fails to reinitialize its UVC endpoints on resume, producing EPIPE on SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout.

2. Rapid control transfers: sustained rapid SET_CUR operations (hundreds over several seconds) overwhelm the firmware.

Add the device to the UVC driver table with:

- UVC_QUIRK_CTRL_THROTTLE: rate-limit SET_CUR (50ms interval) and skip error-code queries after EPIPE to prevent crash trigger #2.

- UVC_QUIRK_DISABLE_AUTOSUSPEND: prevent USB autosuspend transitions that trigger crash #1. Same approach as Insta360 Link.

- UVC_QUIRK_NO_RESET_RESUME: avoid the fragile reset-during-resume path. Same approach as Logitech Rally Bar.

---
 drivers/media/usb/uvc/uvc_driver.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +17 -1
index b0ca81d92..e8b4de942 100644
@@ -2920,6 +2920,23 @@ static const struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+       /*
+        * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+        * and on LPM/autosuspend resume, cascading into xHCI controller
+        * death that disconnects all USB devices on the bus.
+        */
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                               | USB_DEVICE_ID_MATCH_INT_INFO,
+         .idVendor             = 0x1532,
+         .idProduct            = 0x0e05,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+                                       | UVC_QUIRK_DISABLE_AUTOSUSPEND
+                                       | UVC_QUIRK_NO_RESET_RESUME) },
+
        /* Kurokesu C1 PRO */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
--

2.43.0

Signature · 1 line
Ricardo Ribalda
#24 lore raw

Re: [PATCH v5 3/3] media: uvcvideo: add quirks for Razer Kiyo Pro webcam

Hi Ricardo,

Quoted 2 lines · Ricardo Ribalda

When we add a quirk to the list we include the output of lsusb -v -d 1532: to the commit message. Please add it to your next version.

Added the Device Descriptor section from lsusb -v to the v6 commit message for patch 2/2.

Thanks,
JP

Quoted 74 lines · Ricardo Ribalda

Hi JP

When we add a quirk to the list we include the output of lsusb -v -d 1532: to the commit message. Please add it to your next version.

Thanks!

Quoted 59 lines · JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has two failure modes that cascade into full xHCI host controller death, disconnecting every USB device on the bus:

1. LPM/autosuspend resume: the device fails to reinitialize its UVC endpoints on resume, producing EPIPE on SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout.

2. Rapid control transfers: sustained rapid SET_CUR operations (hundreds over several seconds) overwhelm the firmware.

Add the device to the UVC driver table with:

- UVC_QUIRK_CTRL_THROTTLE: rate-limit SET_CUR (50ms interval) and skip error-code queries after EPIPE to prevent crash trigger #2.

- UVC_QUIRK_DISABLE_AUTOSUSPEND: prevent USB autosuspend transitions that trigger crash #1. Same approach as Insta360 Link.

- UVC_QUIRK_NO_RESET_RESUME: avoid the fragile reset-during-resume path. Same approach as Logitech Rally Bar.

---
 drivers/media/usb/uvc/uvc_driver.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +17 -1
index b0ca81d92..e8b4de942 100644
@@ -2920,6 +2920,23 @@ static const struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+       /*
+        * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+        * and on LPM/autosuspend resume, cascading into xHCI controller
+        * death that disconnects all USB devices on the bus.
+        */
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                               | USB_DEVICE_ID_MATCH_INT_INFO,
+         .idVendor             = 0x1532,
+         .idProduct            = 0x0e05,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+                                       | UVC_QUIRK_DISABLE_AUTOSUSPEND
+                                       | UVC_QUIRK_NO_RESET_RESUME) },
+
        /* Kurokesu C1 PRO */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
--
Quoted 2 lines

2.43.0

--
Ricardo Ribalda

Signature · 4 lines
Jeffrey Pine Hein
Just plain helpful.
jphein.com ☀️ techempower.org
(530) 798-4099
author
#25 lore raw

v6 cover media: uvcvideo: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

In reply to JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has a well-documented failure mode that cascades into complete xHCI host controller death, disconnecting every USB device on the bus -- including keyboards and mice, requiring a hard reboot.

The device has two crash triggers:

1. LPM/autosuspend resume: Device enters LPM or autosuspend, fails to reinitialize on resume, producing EPIPE (-32) on UVC SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the host controller dead.

2. Rapid control transfers: sustained rapid UVC control operations (hundreds over several seconds) overwhelm the firmware. The error-code query (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) amplifies the failure by sending a second transfer to the already-stalling device, pushing it into a full lockup and xHCI controller death.

Patch 1 of the original 3-patch series (USB_QUIRK_NO_LPM for 1532:0e05) has been merged by Greg Kroah-Hartman and backported to stable kernels 6.1, 6.6, 6.12, 6.18, and 6.19.

This v6 series covers the remaining two UVC patches:

Patch 1/2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit
all USB control transfers (50ms minimum interval) in __uvc_query_ctrl() and skip the error-code query after EPIPE errors on affected devices.

Patch 2/2: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME.

Changes since v5:
- Moved throttle from uvc_query_ctrl() to __uvc_query_ctrl() so all callers are covered, including uvc_set_video_ctrl() which bypasses the higher-level function (Ricardo Ribalda)
- Throttle now applies to all query types, not just SET_CUR -- the firmware doesn't distinguish between query directions under load (Ricardo Ribalda)
- Added lsusb -v Device Descriptor to patch 2/2 commit message (Ricardo Ribalda)
- Bug reproduced on two separate Kiyo Pro units, confirming not unit-specific

Changes since v4:
- Dropped stable CC (new quirks, not regression fixes)
- Updated cover letter with 6.17 test results

Changes since v3:
- Regenerated patches against media-committers next branch to fix context mismatch (v3 was based on Ubuntu 6.8 source)

Tested on:
- Kernel: 6.17.0-20-generic (Ubuntu 24.04 HWE) and 6.8.0-106-generic
- Hardware: Intel Cannon Lake PCH xHCI (8086:a36d)
- Device: Two Razer Kiyo Pro units (1532:0e05), firmware 1.5.0.1

Stress test, crash evidence, and debug logs:
https://github.com/jphein/kiyo-xhci-fix

JP Hein (2):
media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware
media: uvcvideo: add Razer Kiyo Pro to device info table

 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 drivers/media/usb/uvc/uvc_video.c  | 30 ++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 3 files changed, 49 insertions(+)
Signature · 1 line
2.43.0
author
#26 lore raw

PATCH v6 1/2 media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware

Some UVC devices have firmware that locks up under sustained rapid USB control transfers, crashing the xHCI host controller and taking all USB devices on the bus with it.

The Razer Kiyo Pro (1532:0e05) is the first known example: approximately 25 rapid consecutive control transfers cause the firmware to stall an endpoint. The kernel's standard UVC error recovery (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) then sends a second transfer to the already-stalling device, amplifying the failure into complete firmware lockup and xHCI controller death.

Add UVC_QUIRK_CTRL_THROTTLE which:
- Rate-limits all USB control transfers to 50ms intervals in __uvc_query_ctrl(), the lowest-level UVC control transfer function, ensuring all callers are throttled including uvc_set_video_ctrl() which bypasses uvc_query_ctrl()
- Skips the error-code query after EPIPE to avoid amplifying stalls

The 50ms interval was determined experimentally: the device is stable at this rate under sustained operation, while shorter intervals eventually trigger the firmware bug.

---
 drivers/media/usb/uvc/uvc_video.c | 30 ++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 33 insertions(+)
drivers/media/usb/uvc/uvc_video.c +30 -0
index a5013a7..cee93ac 100644
@@ -36,6 +36,26 @@ static int __uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 	u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
 	unsigned int pipe;
 
+	/*
+	 * Rate-limit control transfers for devices with fragile firmware.
+	 * The Razer Kiyo Pro locks up under sustained rapid control
+	 * transfers (hundreds without delay), crashing the xHCI controller.
+	 * Throttle in this low-level function to cover all callers,
+	 * including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().
+	 */
+	if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE) {
+		unsigned long min_interval = msecs_to_jiffies(50);
+
+		if (dev->last_ctrl_jiffies &&
+		    time_before(jiffies,
+				dev->last_ctrl_jiffies + min_interval)) {
+			unsigned long wait = dev->last_ctrl_jiffies +
+					     min_interval - jiffies;
+			msleep(jiffies_to_msecs(wait));
+		}
+		dev->last_ctrl_jiffies = jiffies;
+	}
+
 	pipe = (query & 0x80) ? usb_rcvctrlpipe(dev->udev, 0)
 			      : usb_sndctrlpipe(dev->udev, 0);
 	type |= (query & 0x80) ? USB_DIR_IN : USB_DIR_OUT;
@@ -108,6 +128,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 		return ret < 0 ? ret : -EPIPE;
 	}
 
+	/*
+	 * Skip the error code query for devices that crash under load.
+	 * The standard error-code query (GET_CUR on
+	 * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+	 * a device that is already stalling, which can amplify the failure
+	 * into a full firmware lockup and xHCI controller death.
+	 */
+	if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+		return -EPIPE;
+
 	/* Reuse data[0] to request the error code. */
 	tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -0
index 757254f..31f2af5 100644
@@ -78,6 +78,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF	0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF		0x00020000
 #define UVC_QUIRK_MSXU_META		0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE		0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED		0x00000001
@@ -583,6 +584,8 @@ struct uvc_device {
 	struct usb_interface *intf;
 	unsigned long warnings;
 	u32 quirks;
+	/* UVC control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+	unsigned long last_ctrl_jiffies;
 	int intfnum;
 	char name[32];
 
Signature · 1 line
2.43.0
#27 lore raw

Re: [PATCH v6 1/2] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware

Quoted 63 lines · JP Hein

Some UVC devices have firmware that locks up under sustained rapid USB control transfers, crashing the xHCI host controller and taking all USB devices on the bus with it.

The Razer Kiyo Pro (1532:0e05) is the first known example: approximately 25 rapid consecutive control transfers cause the firmware to stall an endpoint. The kernel's standard UVC error recovery (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) then sends a second transfer to the already-stalling device, amplifying the failure into complete firmware lockup and xHCI controller death.

Add UVC_QUIRK_CTRL_THROTTLE which:
- Rate-limits all USB control transfers to 50ms intervals in __uvc_query_ctrl(), the lowest-level UVC control transfer function, ensuring all callers are throttled including uvc_set_video_ctrl() which bypasses uvc_query_ctrl()
- Skips the error-code query after EPIPE to avoid amplifying stalls

The 50ms interval was determined experimentally: the device is stable at this rate under sustained operation, while shorter intervals eventually trigger the firmware bug.

---
 drivers/media/usb/uvc/uvc_video.c | 30 ++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 33 insertions(+)
drivers/media/usb/uvc/uvc_video.c +20 -0
index a5013a7..cee93ac 100644
@@ -36,6 +36,26 @@ static int __uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
        u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
        unsigned int pipe;
 
+       /*
+        * Rate-limit control transfers for devices with fragile firmware.
+        * The Razer Kiyo Pro locks up under sustained rapid control
+        * transfers (hundreds without delay), crashing the xHCI controller.
+        * Throttle in this low-level function to cover all callers,
+        * including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE) {
+               unsigned long min_interval = msecs_to_jiffies(50);
+
+               if (dev->last_ctrl_jiffies &&
+                   time_before(jiffies,
+                               dev->last_ctrl_jiffies + min_interval)) {
+                       unsigned long wait = dev->last_ctrl_jiffies +
+                                            min_interval - jiffies;
+                       msleep(jiffies_to_msecs(wait));
+               }
+               dev->last_ctrl_jiffies = jiffies;
+       }
+
        pipe = (query & 0x80) ? usb_rcvctrlpipe(dev->udev, 0)
                              : usb_sndctrlpipe(dev->udev, 0);
        type |= (query & 0x80) ? USB_DIR_IN : USB_DIR_OUT;
@@ -108,6 +128,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
                return ret < 0 ? ret : -EPIPE;
        }

drivers/media/usb/uvc/uvc_video.c int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, · line 139

Quoted 10 lines
drivers/media/usb/uvc/uvc_video.c +9 -0
 
+       /*
+        * Skip the error code query for devices that crash under load.
+        * The standard error-code query (GET_CUR on
+        * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+        * a device that is already stalling, which can amplify the failure
+        * into a full firmware lockup and xHCI controller death.
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+               return -EPIPE;

I do not believe this is needed anymore now that the check is in the inner funcion

Quoted 28 lines
drivers/media/usb/uvc/uvc_video.c +1 -0
+
        /* Reuse data[0] to request the error code. */
        tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -1
index 757254f..31f2af5 100644
@@ -78,6 +78,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF   0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF         0x00020000
 #define UVC_QUIRK_MSXU_META            0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE                0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED                0x00000001
@@ -583,6 +584,8 @@ struct uvc_device {
        struct usb_interface *intf;
        unsigned long warnings;
        u32 quirks;
+       /* UVC control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+       unsigned long last_ctrl_jiffies;
        int intfnum;
        char name[32];
 
--

2.43.0

Signature · 1 line
Ricardo Ribalda
#28 lore raw

Re: [PATCH v6 1/2] media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware

Hi Ricardo,

Agreed -- the error-code query goes through __uvc_query_ctrl() now, so it gets the 50ms throttle automatically. Dropped in v7.

Thanks,
JP

Quoted 111 lines · Ricardo Ribalda
Quoted 63 lines · JP Hein

Some UVC devices have firmware that locks up under sustained rapid USB control transfers, crashing the xHCI host controller and taking all USB devices on the bus with it.

The Razer Kiyo Pro (1532:0e05) is the first known example: approximately 25 rapid consecutive control transfers cause the firmware to stall an endpoint. The kernel's standard UVC error recovery (GET_CUR on UVC_VC_REQUEST_ERROR_CODE_CONTROL) then sends a second transfer to the already-stalling device, amplifying the failure into complete firmware lockup and xHCI controller death.

Add UVC_QUIRK_CTRL_THROTTLE which:
- Rate-limits all USB control transfers to 50ms intervals in __uvc_query_ctrl(), the lowest-level UVC control transfer function, ensuring all callers are throttled including uvc_set_video_ctrl() which bypasses uvc_query_ctrl()
- Skips the error-code query after EPIPE to avoid amplifying stalls

The 50ms interval was determined experimentally: the device is stable at this rate under sustained operation, while shorter intervals eventually trigger the firmware bug.

---
 drivers/media/usb/uvc/uvc_video.c | 30 ++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 33 insertions(+)
drivers/media/usb/uvc/uvc_video.c +20 -0
index a5013a7..cee93ac 100644
@@ -36,6 +36,26 @@ static int __uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
        u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
        unsigned int pipe;
 
+       /*
+        * Rate-limit control transfers for devices with fragile firmware.
+        * The Razer Kiyo Pro locks up under sustained rapid control
+        * transfers (hundreds without delay), crashing the xHCI controller.
+        * Throttle in this low-level function to cover all callers,
+        * including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE) {
+               unsigned long min_interval = msecs_to_jiffies(50);
+
+               if (dev->last_ctrl_jiffies &&
+                   time_before(jiffies,
+                               dev->last_ctrl_jiffies + min_interval)) {
+                       unsigned long wait = dev->last_ctrl_jiffies +
+                                            min_interval - jiffies;
+                       msleep(jiffies_to_msecs(wait));
+               }
+               dev->last_ctrl_jiffies = jiffies;
+       }
+
        pipe = (query & 0x80) ? usb_rcvctrlpipe(dev->udev, 0)
                              : usb_sndctrlpipe(dev->udev, 0);
        type |= (query & 0x80) ? USB_DIR_IN : USB_DIR_OUT;
@@ -108,6 +128,16 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
                return ret < 0 ? ret : -EPIPE;
        }

drivers/media/usb/uvc/uvc_video.c int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, · line 139

Quoted 10 lines
drivers/media/usb/uvc/uvc_video.c +9 -0
 
+       /*
+        * Skip the error code query for devices that crash under load.
+        * The standard error-code query (GET_CUR on
+        * UVC_VC_REQUEST_ERROR_CODE_CONTROL) sends a second USB transfer to
+        * a device that is already stalling, which can amplify the failure
+        * into a full firmware lockup and xHCI controller death.
+        */
+       if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE)
+               return -EPIPE;

I do not believe this is needed anymore now that the check is in the inner funcion

Quoted 26 lines
drivers/media/usb/uvc/uvc_video.c +1 -0
+
        /* Reuse data[0] to request the error code. */
        tmp = *(u8 *)data;
 
drivers/media/usb/uvc/uvcvideo.h +3 -1
index 757254f..31f2af5 100644
@@ -78,6 +78,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF   0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF         0x00020000
 #define UVC_QUIRK_MSXU_META            0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE                0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED                0x00000001
@@ -583,6 +584,8 @@ struct uvc_device {
        struct usb_interface *intf;
        unsigned long warnings;
        u32 quirks;
+       /* UVC control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+       unsigned long last_ctrl_jiffies;
        int intfnum;
        char name[32];
 
--
Quoted 2 lines

2.43.0

--
Ricardo Ribalda

author
#29 lore raw

PATCH v6 2/2 media: uvcvideo: add Razer Kiyo Pro to device info table

In reply to JP Hein

Add a device entry for the Razer Kiyo Pro (1532:0e05) with quirks to work around firmware bugs that crash the xHCI host controller:

UVC_QUIRK_CTRL_THROTTLE - rate-limit control transfers and skip
error-code queries after EPIPE
UVC_QUIRK_DISABLE_AUTOSUSPEND - prevent runtime suspend UVC_QUIRK_NO_RESET_RESUME - skip post-reset reinitialization

The firmware (v1.5.0.1) has two failure modes: it stalls endpoints under rapid control transfers (~25 without delay), and it fails to reinitialize properly after USB power state transitions. Both can cascade into xHCI controller death, disconnecting all USB devices on the bus.

Bug reproduced on two separate Kiyo Pro units running simultaneously, confirming the issue is not unit-specific.

lsusb -v:
Bus 002 Device 002: ID 1532:0e05 Razer USA, Ltd Razer Kiyo Pro Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x1532 Razer USA, Ltd
idProduct 0x0e05 Razer Kiyo Pro
bcdDevice 8.21
iManufacturer 1 Razer Inc
iProduct 2 Razer Kiyo Pro
iSerial 0

---
 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +16 -0
index 775bede..9b6df8e 100644
@@ -2880,6 +2880,22 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+	/*
+	 * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+	 * and on LPM/autosuspend resume, cascading into xHCI controller
+	 * death that disconnects all USB devices on the bus.
+	 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x1532,
+	  .idProduct		= 0x0e05,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+					| UVC_QUIRK_DISABLE_AUTOSUSPEND
+					| UVC_QUIRK_NO_RESET_RESUME) },
 	/* Kurokesu C1 PRO */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0
#30 lore raw

Re: [PATCH v6 2/2] media: uvcvideo: add Razer Kiyo Pro to device info table

Hi

Quoted 18 lines · JP Hein

Add a device entry for the Razer Kiyo Pro (1532:0e05) with quirks to work around firmware bugs that crash the xHCI host controller:

UVC_QUIRK_CTRL_THROTTLE - rate-limit control transfers and skip
error-code queries after EPIPE
UVC_QUIRK_DISABLE_AUTOSUSPEND - prevent runtime suspend UVC_QUIRK_NO_RESET_RESUME - skip post-reset reinitialization

The firmware (v1.5.0.1) has two failure modes: it stalls endpoints under rapid control transfers (~25 without delay), and it fails to reinitialize properly after USB power state transitions. Both can cascade into xHCI controller death, disconnecting all USB devices on the bus.

Bug reproduced on two separate Kiyo Pro units running simultaneously, confirming the issue is not unit-specific.

Quoted 17 lines

lsusb -v:
Bus 002 Device 002: ID 1532:0e05 Razer USA, Ltd Razer Kiyo Pro Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x1532 Razer USA, Ltd
idProduct 0x0e05 Razer Kiyo Pro
bcdDevice 8.21
iManufacturer 1 Razer Inc
iProduct 2 Razer Kiyo Pro
iSerial 0

Is this the whole output of lsusb?? Can you try with lsusb -vv?

Quoted 35 lines
---
 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +16 -1
index 775bede..9b6df8e 100644
@@ -2880,6 +2880,22 @@ static const struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+       /*
+        * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+        * and on LPM/autosuspend resume, cascading into xHCI controller
+        * death that disconnects all USB devices on the bus.
+        */
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                               | USB_DEVICE_ID_MATCH_INT_INFO,
+         .idVendor             = 0x1532,
+         .idProduct            = 0x0e05,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+                                       | UVC_QUIRK_DISABLE_AUTOSUSPEND
+                                       | UVC_QUIRK_NO_RESET_RESUME) },
        /* Kurokesu C1 PRO */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
--

2.43.0

Signature · 1 line
Ricardo Ribalda
#31 lore raw

Re: [PATCH v6 2/2] media: uvcvideo: add Razer Kiyo Pro to device info table

Hi Ricardo,

Full lsusb -vv output included in the v7 commit message.

Thanks,
JP

Quoted 81 lines · Ricardo Ribalda

Hi

Quoted 18 lines · JP Hein

Add a device entry for the Razer Kiyo Pro (1532:0e05) with quirks to work around firmware bugs that crash the xHCI host controller:

UVC_QUIRK_CTRL_THROTTLE - rate-limit control transfers and skip
error-code queries after EPIPE
UVC_QUIRK_DISABLE_AUTOSUSPEND - prevent runtime suspend UVC_QUIRK_NO_RESET_RESUME - skip post-reset reinitialization

The firmware (v1.5.0.1) has two failure modes: it stalls endpoints under rapid control transfers (~25 without delay), and it fails to reinitialize properly after USB power state transitions. Both can cascade into xHCI controller death, disconnecting all USB devices on the bus.

Bug reproduced on two separate Kiyo Pro units running simultaneously, confirming the issue is not unit-specific.

Quoted 17 lines

lsusb -v:
Bus 002 Device 002: ID 1532:0e05 Razer USA, Ltd Razer Kiyo Pro Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x1532 Razer USA, Ltd
idProduct 0x0e05 Razer Kiyo Pro
bcdDevice 8.21
iManufacturer 1 Razer Inc
iProduct 2 Razer Kiyo Pro
iSerial 0

Is this the whole output of lsusb?? Can you try with lsusb -vv?

Quoted 33 lines
---
 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +16 -1
index 775bede..9b6df8e 100644
@@ -2880,6 +2880,22 @@ static const struct usb_device_id uvc_ids[] = {
          .bInterfaceSubClass   = 1,
          .bInterfaceProtocol   = 0,
          .driver_info          = (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+       /*
+        * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+        * and on LPM/autosuspend resume, cascading into xHCI controller
+        * death that disconnects all USB devices on the bus.
+        */
+       { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
+                               | USB_DEVICE_ID_MATCH_INT_INFO,
+         .idVendor             = 0x1532,
+         .idProduct            = 0x0e05,
+         .bInterfaceClass      = USB_CLASS_VIDEO,
+         .bInterfaceSubClass   = 1,
+         .bInterfaceProtocol   = 0,
+         .driver_info          = UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+                                       | UVC_QUIRK_DISABLE_AUTOSUSPEND
+                                       | UVC_QUIRK_NO_RESET_RESUME) },
        /* Kurokesu C1 PRO */
        { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                                | USB_DEVICE_ID_MATCH_INT_INFO,
--
Quoted 2 lines

2.43.0

--
Ricardo Ribalda

author
#32 lore raw

v7 cover media: uvcvideo: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

In reply to JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has a well-documented failure mode that cascades into complete xHCI host controller death, disconnecting every USB device on the bus -- including keyboards and mice, requiring a hard reboot.

The device has two crash triggers:

1. LPM/autosuspend resume: Device enters LPM or autosuspend, fails to reinitialize on resume, producing EPIPE (-32) on UVC SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the host controller dead.

2. Rapid control transfers: sustained rapid UVC control operations (hundreds over several seconds) overwhelm the firmware.

Patch 1 of the original 3-patch series (USB_QUIRK_NO_LPM for 1532:0e05) has been merged by Greg Kroah-Hartman and backported to stable kernels 6.1, 6.6, 6.12, 6.18, and 6.19.

This v7 series covers the remaining two UVC patches:

Patch 1/2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit
all USB control transfers (50ms minimum interval) in __uvc_query_ctrl().

Patch 2/2: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME.

Changes since v6:
- Dropped the error-code query skip after EPIPE -- no longer needed since the throttle in __uvc_query_ctrl() already rate-limits the error-code query path (Ricardo Ribalda)
- Included full lsusb -vv output in patch 2/2 commit message (Ricardo Ribalda)

Changes since v5:
- Moved throttle from uvc_query_ctrl() to __uvc_query_ctrl() so all callers are covered, including uvc_set_video_ctrl() which bypasses the higher-level function (Ricardo Ribalda)
- Throttle now applies to all query types, not just SET_CUR (Ricardo Ribalda)

Changes since v4:
- Dropped stable CC (new quirks, not regression fixes)
- Updated cover letter with 6.17 test results

Changes since v3:
- Regenerated patches against media-committers next branch to fix context mismatch (v3 was based on Ubuntu 6.8 source)

Tested on:
- Kernel: 6.17.0-20-generic (Ubuntu 24.04 HWE) and 6.8.0-106-generic
- Hardware: Intel Cannon Lake PCH xHCI (8086:a36d)
- Device: Two Razer Kiyo Pro units (1532:0e05), firmware 1.5.0.1

Stress test, crash evidence, and debug logs:
https://github.com/jphein/kiyo-xhci-fix

JP Hein (2):
media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware
media: uvcvideo: add Razer Kiyo Pro to device info table

 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 drivers/media/usb/uvc/uvc_video.c  | 20 ++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 3 files changed, 39 insertions(+)
Signature · 1 line
2.43.0
author
#33 lore raw

PATCH v7 1/2 media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware

Some UVC devices have firmware that locks up under sustained rapid USB control transfers, crashing the xHCI host controller and taking all USB devices on the bus with it.

The Razer Kiyo Pro (1532:0e05) is the first known example: approximately 25 rapid consecutive control transfers cause the firmware to stall an endpoint.

Add UVC_QUIRK_CTRL_THROTTLE which rate-limits all USB control transfers to 50ms intervals in __uvc_query_ctrl(), the lowest-level UVC control transfer function, ensuring all callers are throttled including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().

The 50ms interval was determined experimentally: the device is stable at this rate under sustained operation, while shorter intervals eventually trigger the firmware bug.

---
 drivers/media/usb/uvc/uvc_video.c | 20 ++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 23 insertions(+)
drivers/media/usb/uvc/uvc_video.c +20 -0
index a5013a7..1d1206f 100644
@@ -36,6 +36,26 @@ static int __uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 	u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
 	unsigned int pipe;
 
+	/*
+	 * Rate-limit control transfers for devices with fragile firmware.
+	 * The Razer Kiyo Pro locks up under sustained rapid control
+	 * transfers (hundreds without delay), crashing the xHCI controller.
+	 * Throttle in this low-level function to cover all callers,
+	 * including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().
+	 */
+	if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE) {
+		unsigned long min_interval = msecs_to_jiffies(50);
+
+		if (dev->last_ctrl_jiffies &&
+		    time_before(jiffies,
+				dev->last_ctrl_jiffies + min_interval)) {
+			unsigned long wait = dev->last_ctrl_jiffies +
+					     min_interval - jiffies;
+			msleep(jiffies_to_msecs(wait));
+		}
+		dev->last_ctrl_jiffies = jiffies;
+	}
+
 	pipe = (query & 0x80) ? usb_rcvctrlpipe(dev->udev, 0)
 			      : usb_sndctrlpipe(dev->udev, 0);
 	type |= (query & 0x80) ? USB_DIR_IN : USB_DIR_OUT;
drivers/media/usb/uvc/uvcvideo.h +3 -0
index 757254f..31f2af5 100644
@@ -78,6 +78,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF	0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF		0x00020000
 #define UVC_QUIRK_MSXU_META		0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE		0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED		0x00000001
@@ -583,6 +584,8 @@ struct uvc_device {
 	struct usb_interface *intf;
 	unsigned long warnings;
 	u32 quirks;
+	/* UVC control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+	unsigned long last_ctrl_jiffies;
 	int intfnum;
 	char name[32];
 
Signature · 1 line
2.43.0
author
#34 lore raw

PATCH v7 2/2 media: uvcvideo: add Razer Kiyo Pro to device info table

In reply to JP Hein

Add a device entry for the Razer Kiyo Pro (1532:0e05) with quirks to work around firmware bugs that crash the xHCI host controller:

UVC_QUIRK_CTRL_THROTTLE - rate-limit control transfers to prevent
firmware lockup under sustained load
UVC_QUIRK_DISABLE_AUTOSUSPEND - prevent runtime suspend UVC_QUIRK_NO_RESET_RESUME - skip post-reset reinitialization

The firmware (v1.5.0.1) has two failure modes: it stalls endpoints under rapid control transfers (~25 without delay), and it fails to reinitialize properly after USB power state transitions. Both can cascade into xHCI controller death, disconnecting all USB devices on the bus.

Bug reproduced on two separate Kiyo Pro units running simultaneously, confirming the issue is not unit-specific.

lsusb -vv:

Bus 002 Device 002: ID 1532:0e05 Razer USA, Ltd Razer Kiyo Pro Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x1532 Razer USA, Ltd
idProduct 0x0e05 Razer Kiyo Pro
bcdDevice 8.21
iManufacturer 1 Razer Inc
iProduct 2 Razer Kiyo Pro
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x05b4
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 896mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 0
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x0069
dwClockFrequency 30.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 4
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
VideoControl Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 2
guidExtensionCode {2c49d16a-32b8-4485-3ea8-643a152362f2}
bNumControls 6
bNrInPins 1
baSourceID( 0) 6
bControlSize 2
bmControls( 0) 0x3f
bmControls( 1) 0x00
iExtension 0
VideoControl Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 6
guidExtensionCode {23e49ed0-1178-4f31-ae52-d2fb8a8d3b48}
bNumControls 5
bNrInPins 1
baSourceID( 0) 3
bControlSize 2
bmControls( 0) 0xff
bmControls( 1) 0x7f
iExtension 0
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x00020a2e
Auto-Exposure Mode
Auto-Exposure Priority
Exposure Time (Absolute)
Focus (Absolute)
Zoom (Absolute)
PanTilt (Absolute)
Focus, Auto
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 3
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x0000175b
Brightness
Contrast
Saturation
Sharpness
White Balance Temperature
Backlight Compensation
Gain
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0xff
None
NTSC - 525/60
PAL - 625/50
SECAM - 625/50
NTSC - 625/50
PAL - 525/60
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 8
bMaxBurst 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 1 (INPUT_HEADER)
bNumFormats 4
wTotalLength 0x03e6
bEndpointAddress 0x81 EP 1 IN
bmInfo 0
bTerminalLink 4
bStillCaptureMethod 0
bTriggerSupport 0
bTriggerUsage 0
bControlSize 1
bmaControls( 0) 0
bmaControls( 1) 0
bmaControls( 2) 0
bmaControls( 3) 0
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 1
bNumFrameDescriptors 4
guidFormat {32595559-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 294912000
dwMaxBitRate 294912000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 7
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 11
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 884736000
dwMaxBitRate 884736000
dwMaxVideoFrameBufferSize 1843200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 13
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1990656000
dwMaxBitRate 1990656000
dwMaxVideoFrameBufferSize 4147200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 6 (FORMAT_MJPEG)
bFormatIndex 2
bNumFrameDescriptors 4
bFlags 0
Fixed-size samples: No
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 1 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 294912000
dwMaxBitRate 294912000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 7
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 11
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 884736000
dwMaxBitRate 884736000
dwMaxVideoFrameBufferSize 1843200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 13
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1990656000
dwMaxBitRate 1990656000
dwMaxVideoFrameBufferSize 4147200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 28
bDescriptorType 36
bDescriptorSubtype 16 (FORMAT_FRAME_BASED)
bFormatIndex 3
bNumFrameDescriptors 4
guidFormat {34363248-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
bVariableSize 1
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 9
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 15
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 17
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 4
bNumFrameDescriptors 4
guidFormat {3231564e-0000-0010-8000-00aa00389b71}
bBitsPerPixel 12
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 165888000
dwMaxBitRate 165888000
dwMaxVideoFrameBufferSize 345600
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 3
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 663552000
dwMaxBitRate 663552000
dwMaxVideoFrameBufferSize 1382400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 4
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1492992000
dwMaxBitRate 1492992000
dwMaxVideoFrameBufferSize 3110400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
bMaxBurst 0
Mult 2
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
bMaxBurst 10
Mult 2
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 2 Streaming
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 0x0026
bInCollection 1
baInterfaceNr(0) 3
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Microphone
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 5
iTerminal 0
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 5
bSourceID 1
bControlSize 1
bmaControls(0) 0x03
Mute Control
Volume Control
iFeature 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x00c4 1x 196 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 16000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0044 1x 68 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 24000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0064 1x 100 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 4
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 32000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0084 1x 132 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000006
BESL Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000e
Device can operate at Full Speed (12Mbps)
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 2
Lowest fully-functional device speed is High Speed (480Mbps)
bU1DevExitLat 10 micro seconds
bU2DevExitLat 256 micro seconds
Device Status: 0x0000
(Bus Powered)

---
 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +16 -0
index 775bede..9b6df8e 100644
@@ -2880,6 +2880,22 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+	/*
+	 * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+	 * and on LPM/autosuspend resume, cascading into xHCI controller
+	 * death that disconnects all USB devices on the bus.
+	 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x1532,
+	  .idProduct		= 0x0e05,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+					| UVC_QUIRK_DISABLE_AUTOSUSPEND
+					| UVC_QUIRK_NO_RESET_RESUME) },
 	/* Kurokesu C1 PRO */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0
#35 lore raw

Re: [PATCH v7 0/2] media: uvcvideo: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

In reply to JP Hein
Quoted 4 lines · JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has a well-documented failure mode that cascades into complete xHCI host controller death, disconnecting every USB device on the bus -- including keyboards and mice, requiring a hard reboot.

For the record, reloading xhci-pci is usually enough to fix this.

Quoted 9 lines

The device has two crash triggers:

1. LPM/autosuspend resume: Device enters LPM or autosuspend, fails to reinitialize on resume, producing EPIPE (-32) on UVC SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the host controller dead.

2. Rapid control transfers: sustained rapid UVC control operations (hundreds over several seconds) overwhelm the firmware.

That's a bit speculative, it's not entirely clear what happens here. 2 seems possible, but Stop Endpoint timeout and some weird error codes seen in those logs looks like problems with the HC.

And I known that some HCs are reliably killed by stopping SuperSpeed UVC streams, at least with my camera.

Quoted 6 lines

Patch 1 of the original 3-patch series (USB_QUIRK_NO_LPM for 1532:0e05) has been merged by Greg Kroah-Hartman and backported to stable kernels 6.1, 6.6, 6.12, 6.18, and 6.19.

This v7 series covers the remaining two UVC patches:

Quoted 7 lines

Patch 1/2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit all USB control transfers (50ms minimum interval) in __uvc_query_ctrl().

Patch 2/2: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME.

Do these patches actually make a practical difference?

If I'm not mistaken, the results of testing on 6.17 are:

1. The original trigger (spamming UVC control requests alone) doesn't cause breakage anymore.

2. New problems are seen when doing the above while streaming video, and they are still seen even with the UVC patches applied.

#36 lore raw

Re: [PATCH v7 0/2] media: uvcvideo: Add quirks to prevent Razer Kiyo Pro xHCI cascade failure

Quoted 1 line · Michal Pecio

For the record, reloading xhci-pci is usually enough to fix this.

You're right that reloading xhci-pci is a recovery path -- I'll note it. The reason the cover letter says "hard reboot" is that when the HC dies, every USB device on the bus disconnects with it, keyboard and mouse included, so triggering the reload requires SSH from a second machine, SysRq, or some other non-USB input path. For most users on a single-machine desktop the practical recovery is a reboot. I'll reword in the next respin to capture both: "recovery requires rmmod/modprobe xhci-pci or a reboot; since the local input devices disconnect with the HC, most single-machine users will reboot."

Quoted 3 lines

That's a bit speculative, it's not entirely clear what happens here. 2 seems possible, but Stop Endpoint timeout and some weird error codes seen in those logs looks like problems with the HC.

Fair. I'll reword trigger #2 to drop the firmware-internals claim and describe only what we can observe: sustained rapid control activity correlates with the device entering a stalled state that then triggers a separate xHCI-layer failure. Your dual-cancel discussion with Mathias and the vendor-defined event 198 are the right place to characterise the HC-side mechanism; these UVC patches don't claim to explain or fix it.

Quoted 1 line

Do these patches actually make a practical difference?

For CTRL_THROTTLE vs no mitigation, yes -- and I should have led with this. Without any patches the stress test crashes the HC reproducibly at round ~25 (many dmesg captures on file). With CTRL_THROTTLE alone the same stress test runs 500+ rounds without failure. I also tested USB_QUIRK_NO_LPM, DISABLE_AUTOSUSPEND, and avoid_reset_quirk individually via sysfs, and each failed to prevent the stress-test crash in isolation; a combined udev rule with all three still crashed at ~round 25. Only CTRL_THROTTLE (or the coarser USB_QUIRK_DELAY_CTRL_MSG at 200 ms) prevented it.

Where my data is actually thin is the interaction with your xhci test patch specifically. The Apr 10 runs comparing "full stack + your patch" (HC died) against "your patch alone" (HC survived) are N=1 each, and the lock-up path is timing-sensitive, so I shouldn't be drawing conclusions from single outcomes on that axis. Before respinning, I'll run a replication matrix on 6.17:

* stock (no patches)
* stock + your xhci test patch
* stock + NO_LPM
* stock + NO_LPM + CTRL_THROTTLE
* stock + NO_LPM + CTRL_THROTTLE + your xhci test patch

each under two workloads -- control-spam only, and control-spam during an active v4l2 stream -- at N >= 5 per cell, with xhci_hcd and usbcore dynamic debug enabled. I'll post the matrix with logs before the next respin. That should tell us whether CTRL_THROTTLE still earns its keep once your xhci patch is applied, which is the real open question.

Two things I'll fold in regardless of how the matrix reads:

1. The cover-letter language fixes above.

2. Clarifying in the commit messages that CTRL_THROTTLE and the device-table entry are a device-local firmware-workaround layer, not a claim on the HC-side issue -- which is Mathias's territory and I don't want to conflate them.

If the matrix shows the throttle doesn't buy anything above your xhci patch, I'll say so plainly and we can discuss whether the device-table entry alone (DISABLE_AUTOSUSPEND + NO_RESET_RESUME, matching the Logitech Rally Bar entry in uvc_driver.c) is still worth landing on its own.

Thanks for the pushback -- it forced me to look harder at my own data.

JP

Quoted 49 lines · Michal Pecio
Quoted 4 lines · JP Hein

The Razer Kiyo Pro (1532:0e05) is a USB 3.0 webcam whose firmware has a well-documented failure mode that cascades into complete xHCI host controller death, disconnecting every USB device on the bus -- including keyboards and mice, requiring a hard reboot.

For the record, reloading xhci-pci is usually enough to fix this.

Quoted 9 lines

The device has two crash triggers:

1. LPM/autosuspend resume: Device enters LPM or autosuspend, fails to reinitialize on resume, producing EPIPE (-32) on UVC SET_CUR. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the host controller dead.

2. Rapid control transfers: sustained rapid UVC control operations (hundreds over several seconds) overwhelm the firmware.

That's a bit speculative, it's not entirely clear what happens here. 2 seems possible, but Stop Endpoint timeout and some weird error codes seen in those logs looks like problems with the HC.

And I known that some HCs are reliably killed by stopping SuperSpeed UVC streams, at least with my camera.

Quoted 6 lines

Patch 1 of the original 3-patch series (USB_QUIRK_NO_LPM for 1532:0e05) has been merged by Greg Kroah-Hartman and backported to stable kernels 6.1, 6.6, 6.12, 6.18, and 6.19.

This v7 series covers the remaining two UVC patches:

Quoted 7 lines

Patch 1/2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit all USB control transfers (50ms minimum interval) in __uvc_query_ctrl().

Patch 2/2: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME.

Do these patches actually make a practical difference?

If I'm not mistaken, the results of testing on 6.17 are:

1. The original trigger (spamming UVC control requests alone) doesn't cause breakage anymore.

2. New problems are seen when doing the above while streaming video, and they are still seen even with the UVC patches applied.

Signature · 4 lines
Jeffrey Pine Hein
Just plain helpful.
jphein.com ☀️ techempower.org
(530) 798-4099
author
#37 lore raw

v8 cover media: uvcvideo: Quirks for Razer Kiyo Pro firmware lockup

In reply to JP Hein

The Razer Kiyo Pro (1532:0e05) firmware has multiple lockup paths that cascade into xHCI host controller death, disconnecting every USB device on the bus -- including keyboard and mouse, requiring a hard reboot.

The bug has two layers:

* Trigger (device firmware -- Sigmastar SAV630D + AIT camera, fw 1.5.0.1 / bcdDevice 8.21). Three failure paths:

- LPM / autosuspend resume: device fails to reinitialize after a USB Link Power Management transition, returning EPIPE on the first UVC SET_CUR. Mitigated by USB_QUIRK_NO_LPM (patch 1 of the original 3-patch series, merged by Greg Kroah-Hartman, backported to stable 6.1, 6.6, 6.12, 6.18, and 6.19).
- Rapid control transfers: sustained UVC control operations overwhelm the firmware, causing endpoint stalls. Mitigated by UVC_QUIRK_CTRL_THROTTLE (this series).
- USB descriptor spec violation: SuperSpeed Endpoint Companion descriptor for EP5 IN (interrupt) declares wBytesPerInterval=8 but wMaxPacketSize=64. xHCI derives max_esit_payload from the former, underallocating bandwidth and producing spurious COMP_SHORT_PACKET events under load.

* Cascade (host controller). Firmware lockup or stalled endpoint cascades to xhci_hc_died(). Severity is silicon-dependent: per Michal Pecio's reports on linux-usb, ASMedia hosts hit hc_died in seconds under both the dual-cancel and SHORT_PACKET-flood paths. Intel Cannon Lake (this series tested) survives the cancel/resubmit and stream-mmap teardown reproducers clean.

This series addresses trigger #2 only. Trigger #1 is already mitigated upstream. Trigger #3 is a host-side bandwidth-allocation concern; Michal Pecio is prototyping an xhci ring patch (clamp max_esit_payload
+ retry on COMP_SHORT_PACKET) on linux-usb. The two efforts are
complementary: this series prevents the firmware from getting into the locked state that triggers the cascade; Michal's patch makes the host side more resilient when the firmware does lock up.

Why kernel-side mitigation is the only viable path: we attempted a firmware fix. The wBytesPerInterval bug byte is at offset 0x1F570A in the raw firmware image distributed with Razer's Windows updater. We reverse-engineered the UVC Extension Unit flash protocol the updater uses (XU6 selector 3, 32-byte chunks, status 0x82 = success) and implemented a Linux flash tool. The device acknowledges writes and reports burn-complete but does not persist after power cycle. The ROM-boot recovery entry path is locked out in production firmware. There is no userspace path to fix the bug on shipped devices.
Forensics: firmware-analysis/ in the linked repository.

This v8 series covers the remaining two UVC patches:

Patch 1/2: UVC driver -- introduce UVC_QUIRK_CTRL_THROTTLE to rate-limit
all USB control transfers (50ms minimum interval) in __uvc_query_ctrl(). The 50ms threshold is the minimum that empirically prevents firmware overflow, 4x shorter than USB_QUIRK_DELAY_CTRL_MSG's 200ms and scoped specifically to UVC. Quirk is opt-in by device-table entry; non-quirked devices are unaffected.

Patch 2/2: UVC driver -- add Razer Kiyo Pro device table entry with
UVC_QUIRK_CTRL_THROTTLE, UVC_QUIRK_DISABLE_AUTOSUSPEND, and UVC_QUIRK_NO_RESET_RESUME. CTRL_THROTTLE rate-limits the rapid-SET_CUR trigger (verified via stress test, see results below). The other two cover related failure paths in line with patterns established for similar fragile UVC firmware (Insta360 Link, Logitech Rally Bar).

Test results:

* stress-test-kiyo.sh (rapid SET_CUR flood, ~25 controls per round):
- stock kernel + stock uvcvideo, no quirks: hc_died at round ~25
- with UVC_QUIRK_CTRL_THROTTLE active: 500+ rounds clean

* Michal Pecio's hammerint (libusb submit/cancel on EP 0x85 IN), Intel Cannon Lake, 60s x 2 Kiyos:
- 413,738 and 416,350 cycles respectively, both timed out cleanly. No xhci_hc_died, no "event condition 198", no command timeouts. NO_LPM was active that boot but inert at this rate (~6900 cycles/sec leaves no idle time for LPM transitions).

* stream-mmap loop (v4l2-ctl open / format / stream / close), Intel Cannon Lake, 300s x 2 Kiyos at MJPG 1920x1080 @ 30fps, no quirks active:
- 134 and 92 cycles respectively, both clean. No fatal patterns in dmesg.post.

Cross-platform corroboration: the same v4l2-ctl focus_absolute reproducer is reported on Linux ARM (Raspberry Pi), Windows, and macOS by independent users. Refs in kernel-patches/upstream-report.md section "Third-Party Reproduction Evidence".

Changes since v7:
- Reframed scope: this series mitigates the firmware-lockup trigger, not the xHCI cascade. The cascade is silicon-dependent and is being addressed separately by Michal Pecio's xhci ring patch on linux-usb.
- Added test data: hammerint and stream-mmap loop on Intel Cannon Lake, both clean (~414K/416K cycles per Kiyo over 60s and 134/92 cycles per Kiyo over 300s respectively).
- Added firmware reverse-engineering note: bug byte located at 0x1F570A in fwimage.bin, UVC XU flash protocol implemented, no userspace path to persist firmware fixes on shipped devices.
- Cross-platform corroboration cited.
- No code changes from v7. v8 is a re-send to integrate post-v7 discussion on the v5 2/3 chain.

Changes since v6:
- Dropped error-code query skip after EPIPE (Ricardo Ribalda)
- Included full lsusb -vv in patch 2/2 commit message (Ricardo Ribalda)

Changes since v5:
- Moved throttle from uvc_query_ctrl() to __uvc_query_ctrl() so all callers are covered (Ricardo Ribalda)
- Throttle applies to all query types, not just SET_CUR (Ricardo Ribalda)

Tested on:
- Kernel: 6.17.0-20-generic (Ubuntu 24.04 HWE), 6.17.0-xhci-test (with Michal Pecio's max_esit_payload + COMP_SHORT_PACKET retry), 6.8.0-106-generic
- Hardware: Intel Cannon Lake PCH xHCI (8086:a36d)
- Device: Two Razer Kiyo Pro units (1532:0e05), firmware 1.5.0.1

    (bcdDevice 8.21)

Reproducers and full debug logs:
https://github.com/jphein/kiyo-xhci-fix
- kernel-patches/stress-test-kiyo.sh
- kernel-patches/matrix/michal-tests/hammerint.c (Michal Pecio's, alongside the harness)
- kernel-patches/matrix/michal-tests/stream-loop.sh

JP Hein (2):
media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware
media: uvcvideo: add Razer Kiyo Pro to device info table

 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 drivers/media/usb/uvc/uvc_video.c  | 20 ++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 3 files changed, 39 insertions(+)

--
2.43.0

author
#38 lore raw

PATCH v8 1/2 media: uvcvideo: add UVC_QUIRK_CTRL_THROTTLE for fragile USB firmware

Some UVC devices have firmware that locks up under sustained rapid USB control transfers, crashing the xHCI host controller and taking all USB devices on the bus with it.

The Razer Kiyo Pro (1532:0e05) is the first known example: approximately 25 rapid consecutive control transfers cause the firmware to stall an endpoint.

Add UVC_QUIRK_CTRL_THROTTLE which rate-limits all USB control transfers to 50ms intervals in __uvc_query_ctrl(), the lowest-level UVC control transfer function, ensuring all callers are throttled including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().

The 50ms interval was determined experimentally: the device is stable at this rate under sustained operation, while shorter intervals eventually trigger the firmware bug.

---
 drivers/media/usb/uvc/uvc_video.c | 20 ++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h  |  3 +++
 2 files changed, 23 insertions(+)
drivers/media/usb/uvc/uvc_video.c +20 -0
index a5013a7..1d1206f 100644
@@ -36,6 +36,26 @@ static int __uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
 	u8 type = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
 	unsigned int pipe;
 
+	/*
+	 * Rate-limit control transfers for devices with fragile firmware.
+	 * The Razer Kiyo Pro locks up under sustained rapid control
+	 * transfers (hundreds without delay), crashing the xHCI controller.
+	 * Throttle in this low-level function to cover all callers,
+	 * including uvc_set_video_ctrl() which bypasses uvc_query_ctrl().
+	 */
+	if (dev->quirks & UVC_QUIRK_CTRL_THROTTLE) {
+		unsigned long min_interval = msecs_to_jiffies(50);
+
+		if (dev->last_ctrl_jiffies &&
+		    time_before(jiffies,
+				dev->last_ctrl_jiffies + min_interval)) {
+			unsigned long wait = dev->last_ctrl_jiffies +
+					     min_interval - jiffies;
+			msleep(jiffies_to_msecs(wait));
+		}
+		dev->last_ctrl_jiffies = jiffies;
+	}
+
 	pipe = (query & 0x80) ? usb_rcvctrlpipe(dev->udev, 0)
 			      : usb_sndctrlpipe(dev->udev, 0);
 	type |= (query & 0x80) ? USB_DIR_IN : USB_DIR_OUT;
drivers/media/usb/uvc/uvcvideo.h +3 -0
index 757254f..31f2af5 100644
@@ -78,6 +78,7 @@
 #define UVC_QUIRK_INVALID_DEVICE_SOF	0x00010000
 #define UVC_QUIRK_MJPEG_NO_EOF		0x00020000
 #define UVC_QUIRK_MSXU_META		0x00040000
+#define UVC_QUIRK_CTRL_THROTTLE		0x00080000
 
 /* Format flags */
 #define UVC_FMT_FLAG_COMPRESSED		0x00000001
@@ -583,6 +584,8 @@ struct uvc_device {
 	struct usb_interface *intf;
 	unsigned long warnings;
 	u32 quirks;
+	/* UVC control transfer throttling (UVC_QUIRK_CTRL_THROTTLE) */
+	unsigned long last_ctrl_jiffies;
 	int intfnum;
 	char name[32];
 
Signature · 1 line
2.43.0
author
#39 lore raw

PATCH v8 2/2 media: uvcvideo: add Razer Kiyo Pro to device info table

In reply to JP Hein

Add a device entry for the Razer Kiyo Pro (1532:0e05) with quirks to work around firmware bugs that crash the xHCI host controller:

UVC_QUIRK_CTRL_THROTTLE - rate-limit control transfers to prevent
firmware lockup under sustained load
UVC_QUIRK_DISABLE_AUTOSUSPEND - prevent runtime suspend UVC_QUIRK_NO_RESET_RESUME - skip post-reset reinitialization

The firmware (v1.5.0.1) has two failure modes: it stalls endpoints under rapid control transfers (~25 without delay), and it fails to reinitialize properly after USB power state transitions. Both can cascade into xHCI controller death, disconnecting all USB devices on the bus.

Bug reproduced on two separate Kiyo Pro units running simultaneously, confirming the issue is not unit-specific.

lsusb -vv:

Bus 002 Device 002: ID 1532:0e05 Razer USA, Ltd Razer Kiyo Pro Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x1532 Razer USA, Ltd
idProduct 0x0e05 Razer Kiyo Pro
bcdDevice 8.21
iManufacturer 1 Razer Inc
iProduct 2 Razer Kiyo Pro
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x05b4
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 896mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 0
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x0069
dwClockFrequency 30.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 4
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
VideoControl Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 2
guidExtensionCode {2c49d16a-32b8-4485-3ea8-643a152362f2}
bNumControls 6
bNrInPins 1
baSourceID( 0) 6
bControlSize 2
bmControls( 0) 0x3f
bmControls( 1) 0x00
iExtension 0
VideoControl Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 6 (EXTENSION_UNIT)
bUnitID 6
guidExtensionCode {23e49ed0-1178-4f31-ae52-d2fb8a8d3b48}
bNumControls 5
bNrInPins 1
baSourceID( 0) 3
bControlSize 2
bmControls( 0) 0xff
bmControls( 1) 0x7f
iExtension 0
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x00020a2e
Auto-Exposure Mode
Auto-Exposure Priority
Exposure Time (Absolute)
Focus (Absolute)
Zoom (Absolute)
PanTilt (Absolute)
Focus, Auto
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 3
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x0000175b
Brightness
Contrast
Saturation
Sharpness
White Balance Temperature
Backlight Compensation
Gain
Power Line Frequency
White Balance Temperature, Auto
iProcessing 0
bmVideoStandards 0xff
None
NTSC - 525/60
PAL - 625/50
SECAM - 625/50
NTSC - 625/50
PAL - 525/60
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 8
bMaxBurst 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 17
bDescriptorType 36
bDescriptorSubtype 1 (INPUT_HEADER)
bNumFormats 4
wTotalLength 0x03e6
bEndpointAddress 0x81 EP 1 IN
bmInfo 0
bTerminalLink 4
bStillCaptureMethod 0
bTriggerSupport 0
bTriggerUsage 0
bControlSize 1
bmaControls( 0) 0
bmaControls( 1) 0
bmaControls( 2) 0
bmaControls( 3) 0
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 1
bNumFrameDescriptors 4
guidFormat {32595559-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 294912000
dwMaxBitRate 294912000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 7
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 11
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 884736000
dwMaxBitRate 884736000
dwMaxVideoFrameBufferSize 1843200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 13
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1990656000
dwMaxBitRate 1990656000
dwMaxVideoFrameBufferSize 4147200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 6 (FORMAT_MJPEG)
bFormatIndex 2
bNumFrameDescriptors 4
bFlags 0
Fixed-size samples: No
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 1 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 294912000
dwMaxBitRate 294912000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 7
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 11
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 884736000
dwMaxBitRate 884736000
dwMaxVideoFrameBufferSize 1843200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 13
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1990656000
dwMaxBitRate 1990656000
dwMaxVideoFrameBufferSize 4147200
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 28
bDescriptorType 36
bDescriptorSubtype 16 (FORMAT_FRAME_BASED)
bFormatIndex 3
bNumFrameDescriptors 4
guidFormat {34363248-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
bVariableSize 1
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 9
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 15
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 17 (FRAME_FRAME_BASED)
bFrameIndex 17
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 251658240
dwMaxBitRate 503316480
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwBytesPerLine 0
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 4
bNumFrameDescriptors 4
guidFormat {3231564e-0000-0010-8000-00aa00389b71}
bBitsPerPixel 12
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 221184000
dwMaxBitRate 221184000
dwMaxVideoFrameBufferSize 460800
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 360
dwMinBitRate 165888000
dwMaxBitRate 165888000
dwMaxVideoFrameBufferSize 345600
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 3
bmCapabilities 0x00
Still image unsupported
wWidth 1280
wHeight 720
dwMinBitRate 663552000
dwMaxBitRate 663552000
dwMaxVideoFrameBufferSize 1382400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 54
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 4
bmCapabilities 0x00
Still image unsupported
wWidth 1920
wHeight 1080
dwMinBitRate 1492992000
dwMaxBitRate 1492992000
dwMaxVideoFrameBufferSize 3110400
dwDefaultFrameInterval 166666
bFrameIntervalType 7
dwFrameInterval( 0) 166666
dwFrameInterval( 1) 333333
dwFrameInterval( 2) 416666
dwFrameInterval( 3) 500000
dwFrameInterval( 4) 666666
dwFrameInterval( 5) 1000000
dwFrameInterval( 6) 2000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
bMaxBurst 0
Mult 2
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 1
bMaxBurst 10
Mult 2
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 2 Streaming
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 0x0026
bInCollection 1
baInterfaceNr(0) 3
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Microphone
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 5
iTerminal 0
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 5
bSourceID 1
bControlSize 1
bmaControls(0) 0x03
Mute Control
Volume Control
iFeature 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 48000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x00c4 1x 196 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 16000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0044 1x 68 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 24000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0064 1x 100 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 4
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 0
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 2 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 32000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x0084 1x 132 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
bMaxBurst 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x01
Sampling Frequency
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000006
BESL Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000e
Device can operate at Full Speed (12Mbps)
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 2
Lowest fully-functional device speed is High Speed (480Mbps)
bU1DevExitLat 10 micro seconds
bU2DevExitLat 256 micro seconds
Device Status: 0x0000
(Bus Powered)

---
 drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +16 -0
index 775bede..9b6df8e 100644
@@ -2880,6 +2880,22 @@ static const struct usb_device_id uvc_ids[] = {
 	  .bInterfaceSubClass	= 1,
 	  .bInterfaceProtocol	= 0,
 	  .driver_info		= (kernel_ulong_t)&uvc_quirk_probe_minmax },
+
+	/*
+	 * Razer Kiyo Pro -- firmware crashes under rapid control transfers
+	 * and on LPM/autosuspend resume, cascading into xHCI controller
+	 * death that disconnects all USB devices on the bus.
+	 */
+	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
+				| USB_DEVICE_ID_MATCH_INT_INFO,
+	  .idVendor		= 0x1532,
+	  .idProduct		= 0x0e05,
+	  .bInterfaceClass	= USB_CLASS_VIDEO,
+	  .bInterfaceSubClass	= 1,
+	  .bInterfaceProtocol	= 0,
+	  .driver_info		= UVC_INFO_QUIRK(UVC_QUIRK_CTRL_THROTTLE
+					| UVC_QUIRK_DISABLE_AUTOSUSPEND
+					| UVC_QUIRK_NO_RESET_RESUME) },
 	/* Kurokesu C1 PRO */
 	{ .match_flags		= USB_DEVICE_ID_MATCH_DEVICE
 				| USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.43.0