[PATCH] docs: driver-api: usb: Document USBDEVFS_BULK return value and short reads
From: Malaya Kumar Rout
Date: Thu Mar 05 2026 - 13:08:16 EST
Remove a longstanding FIXME comment in the USBDEVFS_BULK documentation
by properly documenting the return value behavior. The ioctl returns the
actual number of bytes transferred on success, which naturally handles
short reads (where fewer bytes are read than requested) by returning a
value less than the requested length.
This information was verified by examining the implementation in
drivers/usb/core/devio.c:do_proc_bulk(), which returns the actual
transfer length on success.
Signed-off-by: Malaya Kumar Rout <malayarout91@xxxxxxxxx>
---
Documentation/driver-api/usb/usb.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/driver-api/usb/usb.rst b/Documentation/driver-api/usb/usb.rst
index 7f2f41e80c1c..a01d72af479b 100644
--- a/Documentation/driver-api/usb/usb.rst
+++ b/Documentation/driver-api/usb/usb.rst
@@ -539,6 +539,12 @@ USBDEVFS_BULK
kernels support requests up to about 128KBytes. *FIXME say how read
length is returned, and how short reads are handled.*.
+ kernels support requests up to about 128KBytes. On success, the
+ ioctl returns the number of bytes actually transferred. Short reads
+ are supported; if fewer bytes are received than requested, only the
+ actual number of bytes received are copied to the buffer and that
+ count is returned. On error, a negative error code is returned.
+
USBDEVFS_CLEAR_HALT
Clears endpoint halt (stall) and resets the endpoint toggle. This is
only meaningful for bulk or interrupt endpoints. The ioctl parameter
--
2.53.0