mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xhci: Fix HIK camera control timeout on Etron hosts
@ 2026-09-14  1:30 Kuangyi Chiang
  2026-09-14 11:09 ` Michal Pecio
  0 siblings, 1 reply; 2+ messages in thread
From: Kuangyi Chiang @ 2026-09-14  1:30 UTC (permalink / raw)
  To: mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel, ki.chiang65

Control transfers to the HIK 1080P Camera (2bdf:0280) can time out when
the device is connected through an Etron xHCI host:

[   48.363671] uvcvideo: Found UVC 1.00 device HIK 1080P Camera (2bdf:0280)
[   53.465662] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
[   58.585653] uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).
[   58.592967] uvcvideo: Failed to initialize the device (-5).

Testing shows that at least 125 us between control transfers is required
to avoid the timeout. Limit the workaround to the affected Etron host and
USB device combination to avoid changing control-transfer timing for other
devices.

Perform the delay before taking xhci->lock so the existing state validation
and TD queueing remain in the same critical section. Use udelay() because
urb_enqueue() may be called from atomic context and cannot use a sleeping
delay.

Signed-off-by: Kuangyi Chiang <ki.chiang65@gmail.com>
---
 drivers/usb/host/xhci.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5c759ad..925716a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1648,6 +1648,16 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
 
 	trace_xhci_urb_enqueue(urb);
 
+	/*
+	 * This camera needs at least 125 us between control transfers
+	 * when used with an Etron xHCI host.
+	 */
+	if ((xhci->quirks & XHCI_ETRON_HOST) &&
+	    usb_endpoint_xfer_control(&urb->ep->desc) &&
+	    le16_to_cpu(urb->dev->descriptor.idVendor) == 0x2bdf &&
+	    le16_to_cpu(urb->dev->descriptor.idProduct) == 0x0280)
+		udelay(125);
+
 	spin_lock_irqsave(&xhci->lock, flags);
 
 	ret = xhci_check_args(hcd, urb->dev, urb->ep,
-- 
2.25.1


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

end of thread, other threads:[~2026-09-14 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14  1:30 [PATCH] xhci: Fix HIK camera control timeout on Etron hosts Kuangyi Chiang
2026-09-14 11:09 ` Michal Pecio

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

all inboxes | Powered by JetHome®