Linux USB
 help / color / mirror / Atom feed
From: Keisuke Tsukuda <tkdkei@outlook.jp>
To: "nkapron@google.com" <nkapron@google.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"corbet@lwn.net" <corbet@lwn.net>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
	"rdunlap@infradead.org" <rdunlap@infradead.org>,
	Keisuke Tsukuda <tkdkei@outlook.jp>
Subject: [PATCH] docs: usb: correct UVC Gadget streaming header links
Date: Tue, 1 Dec 2026 08:46:20 +0000	[thread overview]
Message-ID: <20261201084616.4770-1-tkdkei@outlook.jp> (raw)

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

             reply	other threads:[~2026-12-01  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  8:46 Keisuke Tsukuda [this message]
2026-12-01  8:53 ` [PATCH] docs: usb: correct UVC Gadget streaming header links sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201084616.4770-1-tkdkei@outlook.jp \
    --to=tkdkei@outlook.jp \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nkapron@google.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox