diff options
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 49b6edb84a79..1e36dbb48366 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2598,15 +2598,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
2598 | if (command) { | 2598 | if (command) { |
2599 | cmd_completion = command->completion; | 2599 | cmd_completion = command->completion; |
2600 | cmd_status = &command->status; | 2600 | cmd_status = &command->status; |
2601 | command->command_trb = xhci->cmd_ring->enqueue; | 2601 | command->command_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
2602 | |||
2603 | /* Enqueue pointer can be left pointing to the link TRB, | ||
2604 | * we must handle that | ||
2605 | */ | ||
2606 | if (TRB_TYPE_LINK_LE32(command->command_trb->link.control)) | ||
2607 | command->command_trb = | ||
2608 | xhci->cmd_ring->enq_seg->next->trbs; | ||
2609 | |||
2610 | list_add_tail(&command->cmd_list, &virt_dev->cmd_list); | 2602 | list_add_tail(&command->cmd_list, &virt_dev->cmd_list); |
2611 | } else { | 2603 | } else { |
2612 | cmd_completion = &virt_dev->cmd_completion; | 2604 | cmd_completion = &virt_dev->cmd_completion; |
@@ -2614,7 +2606,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
2614 | } | 2606 | } |
2615 | init_completion(cmd_completion); | 2607 | init_completion(cmd_completion); |
2616 | 2608 | ||
2617 | cmd_trb = xhci->cmd_ring->dequeue; | 2609 | cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
2618 | if (!ctx_change) | 2610 | if (!ctx_change) |
2619 | ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma, | 2611 | ret = xhci_queue_configure_endpoint(xhci, in_ctx->dma, |
2620 | udev->slot_id, must_succeed); | 2612 | udev->slot_id, must_succeed); |
@@ -3439,14 +3431,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3439 | 3431 | ||
3440 | /* Attempt to submit the Reset Device command to the command ring */ | 3432 | /* Attempt to submit the Reset Device command to the command ring */ |
3441 | spin_lock_irqsave(&xhci->lock, flags); | 3433 | spin_lock_irqsave(&xhci->lock, flags); |
3442 | reset_device_cmd->command_trb = xhci->cmd_ring->enqueue; | 3434 | reset_device_cmd->command_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
3443 | |||
3444 | /* Enqueue pointer can be left pointing to the link TRB, | ||
3445 | * we must handle that | ||
3446 | */ | ||
3447 | if (TRB_TYPE_LINK_LE32(reset_device_cmd->command_trb->link.control)) | ||
3448 | reset_device_cmd->command_trb = | ||
3449 | xhci->cmd_ring->enq_seg->next->trbs; | ||
3450 | 3435 | ||
3451 | list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list); | 3436 | list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list); |
3452 | ret = xhci_queue_reset_device(xhci, slot_id); | 3437 | ret = xhci_queue_reset_device(xhci, slot_id); |
@@ -3650,7 +3635,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
3650 | union xhci_trb *cmd_trb; | 3635 | union xhci_trb *cmd_trb; |
3651 | 3636 | ||
3652 | spin_lock_irqsave(&xhci->lock, flags); | 3637 | spin_lock_irqsave(&xhci->lock, flags); |
3653 | cmd_trb = xhci->cmd_ring->dequeue; | 3638 | cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
3654 | ret = xhci_queue_slot_control(xhci, TRB_ENABLE_SLOT, 0); | 3639 | ret = xhci_queue_slot_control(xhci, TRB_ENABLE_SLOT, 0); |
3655 | if (ret) { | 3640 | if (ret) { |
3656 | spin_unlock_irqrestore(&xhci->lock, flags); | 3641 | spin_unlock_irqrestore(&xhci->lock, flags); |
@@ -3785,7 +3770,7 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3785 | slot_ctx->dev_info >> 27); | 3770 | slot_ctx->dev_info >> 27); |
3786 | 3771 | ||
3787 | spin_lock_irqsave(&xhci->lock, flags); | 3772 | spin_lock_irqsave(&xhci->lock, flags); |
3788 | cmd_trb = xhci->cmd_ring->dequeue; | 3773 | cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
3789 | ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma, | 3774 | ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma, |
3790 | udev->slot_id); | 3775 | udev->slot_id); |
3791 | if (ret) { | 3776 | if (ret) { |