Linux USB
 help / color / mirror / Atom feed
* [PATCH] docs: usb: correct UVC Gadget streaming header links
@ 2026-12-01  8:46 Keisuke Tsukuda
  2026-12-01  8:53 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Keisuke Tsukuda @ 2026-12-01  8:46 UTC (permalink / raw)
  To: nkapron@google.com, gregkh@linuxfoundation.org, corbet@lwn.net
  Cc: linux-usb@vger.kernel.org, linux-doc@vger.kernel.org,
	skhan@linuxfoundation.org, rdunlap@infradead.org, Keisuke Tsukuda

The UVC Gadget guide says that streaming header links for unused USB
speeds can be omitted. The speed checks were later removed from
uvc_function_bind(). The function now creates Full Speed, High Speed,
SuperSpeed, and SuperSpeed Plus descriptors regardless of the UDC's
speed capabilities or the gadget's max_speed setting. SuperSpeed Plus
uses the ss class. The fs, hs, and ss streaming class links are
therefore all required, even on a High Speed only UDC.

Document that streaming/class/fs, streaming/class/hs, and
streaming/class/ss all need the header link. Correct the summary in
gadget-testing.rst as well.

Fixes: 46decc82ffd5 ("usb: gadget: unconditionally allocate hs/ss descriptor in bind operation")
Signed-off-by: Keisuke Tsukuda <tkdkei@outlook.jp>
---
Verified on a Raspberry Pi CM4 with a High Speed UDC: omitting
streaming/class/ss made uvc_function_bind() fail with -ENODEV, while
the write to the UDC attribute failed with -EBUSY. Restoring the
link allowed the UDC to bind. In a separate all-links boot, a Linux
host enumerated the gadget as a UVC camera.

diff --git a/Documentation/usb/gadget_uvc.rst b/Documentation/usb/gadget_uvc.rst
--- a/Documentation/usb/gadget_uvc.rst
+++ b/Documentation/usb/gadget_uvc.rst
@@ -170,7 +170,13 @@
 Headers detailing things such as the number and cumulative size of the different
 Format descriptors that follow. This and similar operations are achieved in
 configfs by linking between the configfs item representing the header and the
-config items representing those other descriptors, in this manner:
+config items representing those other descriptors.
+
+The UVC function builds streaming descriptors for Full Speed, High Speed,
+SuperSpeed, and SuperSpeed Plus at bind time, regardless of the UDC's speed
+capabilities or the gadget's max_speed setting. SuperSpeed Plus uses the ss
+class. Link the streaming header from the fs, hs, and ss classes below.
+If any of these links is missing, the gadget cannot bind to the UDC.
 
 .. code-block:: bash
 
@@ -182,9 +188,7 @@
 	ln -s ../../uncompressed/yuyv
 	ln -s ../../mjpeg/mjpeg
 
-	# This section ensures that the header will be transmitted for each
-	# speed's set of descriptors. If support for a particular speed is not
-	# needed then it can be skipped here.
+	# Link the streaming header to the USB speed classes
 	cd ../../class/fs
 	ln -s ../../header/h
 	cd ../../class/hs
diff --git a/Documentation/usb/gadget-testing.rst b/Documentation/usb/gadget-testing.rst
--- a/Documentation/usb/gadget-testing.rst
+++ b/Documentation/usb/gadget-testing.rst
@@ -841,7 +841,7 @@
 	control header     create in control/header, link from control/class/fs
 			   and/or control/class/ss
 	streaming header   create in streaming/header, link from
-			   streaming/class/fs and/or streaming/class/hs and/or
+			   streaming/class/fs, streaming/class/hs and
 			   streaming/class/ss
 	format description create in streaming/mjpeg and/or
 			   streaming/uncompressed

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

end of thread, other threads:[~2026-12-01  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  8:46 [PATCH] docs: usb: correct UVC Gadget streaming header links Keisuke Tsukuda
2026-12-01  8:53 ` sashiko-bot

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