aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.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-mem.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-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index c089668308ad..b070a17bf53f 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1821,6 +1821,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
1821 list_del(&cur_cd->cancel_cmd_list); 1821 list_del(&cur_cd->cancel_cmd_list);
1822 kfree(cur_cd); 1822 kfree(cur_cd);
1823 } 1823 }
1824 xhci_cleanup_command_queue(xhci);
1824 1825
1825 for (i = 1; i < MAX_HC_SLOTS; ++i) 1826 for (i = 1; i < MAX_HC_SLOTS; ++i)
1826 xhci_free_virt_device(xhci, i); 1827 xhci_free_virt_device(xhci, i);
@@ -2324,6 +2325,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2324 int i; 2325 int i;
2325 2326
2326 INIT_LIST_HEAD(&xhci->cancel_cmd_list); 2327 INIT_LIST_HEAD(&xhci->cancel_cmd_list);
2328 INIT_LIST_HEAD(&xhci->cmd_list);
2327 2329
2328 page_size = readl(&xhci->op_regs->page_size); 2330 page_size = readl(&xhci->op_regs->page_size);
2329 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2331 xhci_dbg_trace(xhci, trace_xhci_dbg_init,