• Alan Stern's avatar
    USB: usbfs: compute urb->actual_length for isochronous · 965003b3
    Alan Stern authored
    commit 2ef47001 upstream.
    
    The USB kerneldoc says that the actual_length field "is read in
    non-iso completion functions", but the usbfs driver uses it for all
    URB types in processcompl().  Since not all of the host controller
    drivers set actual_length for isochronous URBs, programs using usbfs
    with some host controllers don't work properly.  For example, Minas
    reports that a USB camera controlled by libusb doesn't work properly
    with a dwc2 controller.
    
    It doesn't seem worthwhile to change the HCDs and the documentation,
    since the in-kernel USB class drivers evidently don't rely on
    actual_length for isochronous transfers.  The easiest solution is for
    usbfs to calculate the actual_length value for itself, by adding up
    the lengths of the individual packets in an isochronous transfer.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    CC: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
    Reported-and-tested-by: default avatarwlf <wulf@rock-chips.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    965003b3
devio.c 60.1 KB