aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.c
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2014-05-08 12:26:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-19 21:03:25 -0400
commitc9aa1a2de4cbf7d0db6012fbf86b6ee0c3719470 (patch)
tree418f09500cbbe216460c77689ea6ac7b18e37714 /drivers/usb/host/xhci.c
parentddba5cd0aeff5bbed92ebdf4b1223300b0541e78 (diff)
xhci: Add a global command queue
Create a list to store command structures, add a structure to it every time a command is submitted, and remove it from the list once we get a command completion event matching the command. Callers that wait for completion will free their command structures themselves. The other command structures are freed in the command completion event handler. Also add a check that prevents queuing commands if host is dying 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.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 9a4c6dfa26dc..8dbc41032177 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3732,7 +3732,6 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
3732 timeleft == 0 ? "Timeout" : "Signal"); 3732 timeleft == 0 ? "Timeout" : "Signal");
3733 /* cancel the enable slot request */ 3733 /* cancel the enable slot request */
3734 ret = xhci_cancel_cmd(xhci, NULL, command->command_trb); 3734 ret = xhci_cancel_cmd(xhci, NULL, command->command_trb);
3735 kfree(command);
3736 return ret; 3735 return ret;
3737 } 3736 }
3738 3737
@@ -3891,7 +3890,6 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
3891 timeleft == 0 ? "Timeout" : "Signal", act); 3890 timeleft == 0 ? "Timeout" : "Signal", act);
3892 /* cancel the address device command */ 3891 /* cancel the address device command */
3893 ret = xhci_cancel_cmd(xhci, NULL, command->command_trb); 3892 ret = xhci_cancel_cmd(xhci, NULL, command->command_trb);
3894 kfree(command);
3895 if (ret < 0) 3893 if (ret < 0)
3896 return ret; 3894 return ret;
3897 return -ETIME; 3895 return -ETIME;