diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2014-05-08 12:26:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-19 21:03:25 -0400 |
commit | 9ea1833e4c210ac5580f63495be15502f275c578 (patch) | |
tree | f9eae8830776fa03922f49c05ec09730f01c54a2 /drivers/usb/host/xhci.c | |
parent | c9aa1a2de4cbf7d0db6012fbf86b6ee0c3719470 (diff) |
xhci: Use completion and status in global command queue
Remove the per-device command list and handle_cmd_in_cmd_wait_list()
and use the completion and status variables found in the
command structure in the global command list.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8dbc41032177..64c1ba353856 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2626,8 +2626,6 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
2626 | return -ENOMEM; | 2626 | return -ENOMEM; |
2627 | } | 2627 | } |
2628 | 2628 | ||
2629 | list_add_tail(&command->cmd_list, &virt_dev->cmd_list); | ||
2630 | |||
2631 | if (!ctx_change) | 2629 | if (!ctx_change) |
2632 | ret = xhci_queue_configure_endpoint(xhci, command, | 2630 | ret = xhci_queue_configure_endpoint(xhci, command, |
2633 | command->in_ctx->dma, | 2631 | command->in_ctx->dma, |
@@ -2637,7 +2635,6 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
2637 | command->in_ctx->dma, | 2635 | command->in_ctx->dma, |
2638 | udev->slot_id, must_succeed); | 2636 | udev->slot_id, must_succeed); |
2639 | if (ret < 0) { | 2637 | if (ret < 0) { |
2640 | list_del(&command->cmd_list); | ||
2641 | if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) | 2638 | if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) |
2642 | xhci_free_host_resources(xhci, ctrl_ctx); | 2639 | xhci_free_host_resources(xhci, ctrl_ctx); |
2643 | spin_unlock_irqrestore(&xhci->lock, flags); | 2640 | spin_unlock_irqrestore(&xhci->lock, flags); |
@@ -3499,11 +3496,9 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3499 | /* Attempt to submit the Reset Device command to the command ring */ | 3496 | /* Attempt to submit the Reset Device command to the command ring */ |
3500 | spin_lock_irqsave(&xhci->lock, flags); | 3497 | spin_lock_irqsave(&xhci->lock, flags); |
3501 | 3498 | ||
3502 | list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list); | ||
3503 | ret = xhci_queue_reset_device(xhci, reset_device_cmd, slot_id); | 3499 | ret = xhci_queue_reset_device(xhci, reset_device_cmd, slot_id); |
3504 | if (ret) { | 3500 | if (ret) { |
3505 | xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); | 3501 | xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); |
3506 | list_del(&reset_device_cmd->cmd_list); | ||
3507 | spin_unlock_irqrestore(&xhci->lock, flags); | 3502 | spin_unlock_irqrestore(&xhci->lock, flags); |
3508 | goto command_cleanup; | 3503 | goto command_cleanup; |
3509 | } | 3504 | } |
@@ -3517,13 +3512,6 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3517 | if (timeleft <= 0) { | 3512 | if (timeleft <= 0) { |
3518 | xhci_warn(xhci, "%s while waiting for reset device command\n", | 3513 | xhci_warn(xhci, "%s while waiting for reset device command\n", |
3519 | timeleft == 0 ? "Timeout" : "Signal"); | 3514 | timeleft == 0 ? "Timeout" : "Signal"); |
3520 | spin_lock_irqsave(&xhci->lock, flags); | ||
3521 | /* The timeout might have raced with the event ring handler, so | ||
3522 | * only delete from the list if the item isn't poisoned. | ||
3523 | */ | ||
3524 | if (reset_device_cmd->cmd_list.next != LIST_POISON1) | ||
3525 | list_del(&reset_device_cmd->cmd_list); | ||
3526 | spin_unlock_irqrestore(&xhci->lock, flags); | ||
3527 | ret = -ETIME; | 3515 | ret = -ETIME; |
3528 | goto command_cleanup; | 3516 | goto command_cleanup; |
3529 | } | 3517 | } |
@@ -3895,7 +3883,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
3895 | return -ETIME; | 3883 | return -ETIME; |
3896 | } | 3884 | } |
3897 | 3885 | ||
3898 | switch (virt_dev->cmd_status) { | 3886 | switch (command->status) { |
3899 | case COMP_CTX_STATE: | 3887 | case COMP_CTX_STATE: |
3900 | case COMP_EBADSLT: | 3888 | case COMP_EBADSLT: |
3901 | xhci_err(xhci, "Setup ERROR: setup %s command for slot %d.\n", | 3889 | xhci_err(xhci, "Setup ERROR: setup %s command for slot %d.\n", |
@@ -3918,7 +3906,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
3918 | default: | 3906 | default: |
3919 | xhci_err(xhci, | 3907 | xhci_err(xhci, |
3920 | "ERROR: unexpected setup %s command completion code 0x%x.\n", | 3908 | "ERROR: unexpected setup %s command completion code 0x%x.\n", |
3921 | act, virt_dev->cmd_status); | 3909 | act, command->status); |
3922 | xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); | 3910 | xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); |
3923 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2); | 3911 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2); |
3924 | trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1); | 3912 | trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1); |