]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
xhci: Set URB actual length for stopped control transfers
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 28 Mar 2017 12:55:29 +0000 (15:55 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 21 Apr 2017 08:11:39 +0000 (10:11 +0200)
BugLink: http://bugs.launchpad.net/bugs/1681875
commit 0ab2881a406b9fd46224a3e8253bbc0141b4f844 upstream.

A control transfer that stopped at the status stage incorrectly
warned about a "unexpected TRB Type 4", and did not set the
transferred actual_length for the URB.

The URB actual_length for control transfers should contain the
bytes transferred in the data stage.

Bytes of a partially sent setup stage and missing bytes from
status stage should be left out.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/host/xhci-ring.c

index e32029a31ca4d2ed5856c18e6e10b4b40de1132a..4c101f4161f8f8ce1e0ed53bb92099ed5ec9d260 100644 (file)
@@ -2000,6 +2000,9 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
                case TRB_NORMAL:
                        td->urb->actual_length = requested - remaining;
                        goto finish_td;
+               case TRB_STATUS:
+                       td->urb->actual_length = requested;
+                       goto finish_td;
                default:
                        xhci_warn(xhci, "WARN: unexpected TRB Type %d\n",
                                  trb_type);