Re: [PATCH] media: uvcvideo: Add quirk to retry SET_INTERFACE for SVBONY SV105C

From: Ostashow Constantine

Date: Wed Oct 21 2026 - 09:01:11 EST


Hi Hans,

On 21-Oct-26 12:26, Hans de Goede wrote:
> I wonder if it helps if you insert a fsleep(3000) here on the RPi case?
>
> So that is sleep between the Configure Endpoint and the actual SET_INTERFACE
> ctrl urb being send out.

It doesn't help. usbcore is built into the Pi kernel, so I put the
delay in a small test module instead. It has a kprobe on
usb_control_msg() that does mdelay() only for SET_INTERFACE with
alt != 0 on this camera. In usb_set_interface() that call comes right
after usb_hcd_alloc_bandwidth(), so the delay lands between the
Configure Endpoint completion and the SETUP. It was busy-waiting,
not fsleep(), but the timing on the bus is the same.

xhci-hcd trace events with a 3 ms delay, 5 stream starts:

Configure Endpoint queued
+0.25 ms Configure Endpoint completed, Success
+3.1 ms SET_INTERFACE alt 6 Setup Stage queued
+0.9 ms Transfer Event on the Status Stage TRB, followed by
Reset Endpoint, Configure Endpoint (Drop), Configure
Endpoint (Add)
retry again 3.1 ms after Configure Endpoint, Success

The first attempt failed in 4 of the 5 traced starts, and the fifth
completed after 260 ms. So with 3 ms between Configure Endpoint and
the SETUP, the failure looks just as it does without the delay.

Without tracing, MJPEG 1920x1080, auto exposure, blocks of 10 starts
with the delay settings alternating:

no delay 35/40 first attempts failed
3 ms 32/40
20 ms 29/30

Today the failure rate is much higher than in my earlier series, with
or without the delay. Every failed start recovered with the retry,
including the retries that also had the 3 ms delay in front of them.

> Can you try the camera on the RPi without involving the USB2 hub, or
> are all ports routed through the hub ?

All of them go through the hub. The VL805's USB 2.0 root hub has a
single port, and the VIA hub (2109:3431) is behind it. All four USB-A
ports are on that hub:

Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 001: Dev 002, Class=Hub, Driver=hub/4p, 480M
|__ Port 004: Dev 003, Class=Video, Driver=uvcvideo, 480M

The only port not on that hub is the USB-C port, which is on the
BCM2711's DWC2 controller and not on xHCI at all. I can try it in host
mode if that would tell you something useful, but it wouldn't separate
the VL805 from its hub.

Regards,
Constantine