aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index f69720983fc7..882875465301 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1698,7 +1698,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1698 faked_port_index + 1); 1698 faked_port_index + 1);
1699 if (slot_id && xhci->devs[slot_id]) 1699 if (slot_id && xhci->devs[slot_id])
1700 xhci_ring_device(xhci, slot_id); 1700 xhci_ring_device(xhci, slot_id);
1701 if (bus_state->port_remote_wakeup && (1 << faked_port_index)) { 1701 if (bus_state->port_remote_wakeup & (1 << faked_port_index)) {
1702 bus_state->port_remote_wakeup &= 1702 bus_state->port_remote_wakeup &=
1703 ~(1 << faked_port_index); 1703 ~(1 << faked_port_index);
1704 xhci_test_and_clear_bit(xhci, port_array, 1704 xhci_test_and_clear_bit(xhci, port_array,
@@ -2589,6 +2589,8 @@ cleanup:
2589 (trb_comp_code != COMP_STALL && 2589 (trb_comp_code != COMP_STALL &&
2590 trb_comp_code != COMP_BABBLE)) 2590 trb_comp_code != COMP_BABBLE))
2591 xhci_urb_free_priv(xhci, urb_priv); 2591 xhci_urb_free_priv(xhci, urb_priv);
2592 else
2593 kfree(urb_priv);
2592 2594
2593 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb); 2595 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
2594 if ((urb->actual_length != urb->transfer_buffer_length && 2596 if ((urb->actual_length != urb->transfer_buffer_length &&
@@ -3106,7 +3108,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,
3106 * running_total. 3108 * running_total.
3107 */ 3109 */
3108 packets_transferred = (running_total + trb_buff_len) / 3110 packets_transferred = (running_total + trb_buff_len) /
3109 usb_endpoint_maxp(&urb->ep->desc); 3111 GET_MAX_PACKET(usb_endpoint_maxp(&urb->ep->desc));
3110 3112
3111 if ((total_packet_count - packets_transferred) > 31) 3113 if ((total_packet_count - packets_transferred) > 31)
3112 return 31 << 17; 3114 return 31 << 17;
@@ -3640,7 +3642,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3640 td_len = urb->iso_frame_desc[i].length; 3642 td_len = urb->iso_frame_desc[i].length;
3641 td_remain_len = td_len; 3643 td_remain_len = td_len;
3642 total_packet_count = DIV_ROUND_UP(td_len, 3644 total_packet_count = DIV_ROUND_UP(td_len,
3643 usb_endpoint_maxp(&urb->ep->desc)); 3645 GET_MAX_PACKET(
3646 usb_endpoint_maxp(&urb->ep->desc)));
3644 /* A zero-length transfer still involves at least one packet. */ 3647 /* A zero-length transfer still involves at least one packet. */
3645 if (total_packet_count == 0) 3648 if (total_packet_count == 0)
3646 total_packet_count++; 3649 total_packet_count++;
@@ -3662,9 +3665,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3662 td = urb_priv->td[i]; 3665 td = urb_priv->td[i];
3663 for (j = 0; j < trbs_per_td; j++) { 3666 for (j = 0; j < trbs_per_td; j++) {
3664 u32 remainder = 0; 3667 u32 remainder = 0;
3665 field = TRB_TBC(burst_count) | TRB_TLBPC(residue); 3668 field = 0;
3666 3669
3667 if (first_trb) { 3670 if (first_trb) {
3671 field = TRB_TBC(burst_count) |
3672 TRB_TLBPC(residue);
3668 /* Queue the isoc TRB */ 3673 /* Queue the isoc TRB */
3669 field |= TRB_TYPE(TRB_ISOC); 3674 field |= TRB_TYPE(TRB_ISOC);
3670 /* Assume URB_ISO_ASAP is set */ 3675 /* Assume URB_ISO_ASAP is set */