aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/host/xhci-ring.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 803f6810e996..eabd95544823 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -390,7 +390,8 @@ static struct xhci_segment *find_trb_seg(
390 while (cur_seg->trbs > trb || 390 while (cur_seg->trbs > trb ||
391 &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) { 391 &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) {
392 generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic; 392 generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic;
393 if (TRB_TYPE(generic_trb->field[3]) == TRB_LINK && 393 if ((generic_trb->field[3] & TRB_TYPE_BITMASK) ==
394 TRB_TYPE(TRB_LINK) &&
394 (generic_trb->field[3] & LINK_TOGGLE)) 395 (generic_trb->field[3] & LINK_TOGGLE))
395 *cycle_state = ~(*cycle_state) & 0x1; 396 *cycle_state = ~(*cycle_state) & 0x1;
396 cur_seg = cur_seg->next; 397 cur_seg = cur_seg->next;
@@ -455,7 +456,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
455 BUG(); 456 BUG();
456 457
457 trb = &state->new_deq_ptr->generic; 458 trb = &state->new_deq_ptr->generic;
458 if (TRB_TYPE(trb->field[3]) == TRB_LINK && 459 if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) &&
459 (trb->field[3] & LINK_TOGGLE)) 460 (trb->field[3] & LINK_TOGGLE))
460 state->new_cycle_state = ~(state->new_cycle_state) & 0x1; 461 state->new_cycle_state = ~(state->new_cycle_state) & 0x1;
461 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); 462 next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
@@ -1504,8 +1505,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
1504 for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg; 1505 for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg;
1505 cur_trb != event_trb; 1506 cur_trb != event_trb;
1506 next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) { 1507 next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) {
1507 if (TRB_TYPE(cur_trb->generic.field[3]) != TRB_TR_NOOP && 1508 if ((cur_trb->generic.field[3] &
1508 TRB_TYPE(cur_trb->generic.field[3]) != TRB_LINK) 1509 TRB_TYPE_BITMASK) != TRB_TYPE(TRB_TR_NOOP) &&
1510 (cur_trb->generic.field[3] &
1511 TRB_TYPE_BITMASK) != TRB_TYPE(TRB_LINK))
1509 td->urb->actual_length += 1512 td->urb->actual_length +=
1510 TRB_LEN(cur_trb->generic.field[2]); 1513 TRB_LEN(cur_trb->generic.field[2]);
1511 } 1514 }