|
@@ -1946,7 +1946,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
|
|
if (event_trb != ep_ring->dequeue) {
|
|
if (event_trb != ep_ring->dequeue) {
|
|
/* The event was for the status stage */
|
|
/* The event was for the status stage */
|
|
if (event_trb == td->last_trb) {
|
|
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
|
|
/* Don't overwrite a previously set error code
|
|
*/
|
|
*/
|
|
if ((*status == -EINPROGRESS || *status == 0) &&
|
|
if ((*status == -EINPROGRESS || *status == 0) &&
|
|
@@ -1960,7 +1960,13 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
|
|
td->urb->transfer_buffer_length;
|
|
td->urb->transfer_buffer_length;
|
|
}
|
|
}
|
|
} else {
|
|
} 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->actual_length =
|
|
td->urb->transfer_buffer_length -
|
|
td->urb->transfer_buffer_length -
|
|
EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
|
|
EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
|