aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2015-03-19 08:57:07 +0800
committerAlex Shi <alex.shi@linaro.org>2015-03-19 08:57:07 +0800
commit42f45c9abdea541a9f966553b5e71dd576d432f9 (patch)
treee9189f804b03d19696b0944a5a34ea9427177646 /drivers/usb/host/xhci-ring.c
parent4d8fd56f051e5eea61209de4a3cb0619283a30af (diff)
parentba0bfedf4c9cad58f56a7038d1462ffc21cd33df (diff)
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-androidlsk-v3.10-15.03-androidlinux-linaro-lsk-v3.10-android
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index eb45ac843712..9948890ef93e 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2064,7 +2064,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
if (event_trb != ep_ring->dequeue) {
/* The event was for the status stage */
if (event_trb == td->last_trb) {
- if (td->urb->actual_length != 0) {
+ if (td->urb_length_set) {
/* Don't overwrite a previously set error code
*/
if ((*status == -EINPROGRESS || *status == 0) &&
@@ -2078,7 +2078,13 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
td->urb->transfer_buffer_length;
}
} else {
- /* Maybe the event was for the data stage? */
+ /*
+ * Maybe the event was for the data stage? If so, update
+ * already the actual_length of the URB and flag it as
+ * set, so that it is not overwritten in the event for
+ * the last TRB.
+ */
+ td->urb_length_set = true;
td->urb->actual_length =
td->urb->transfer_buffer_length -
EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));