|
@@ -650,7 +650,7 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
|
|
|
|
|
|
/* Allocate everything needed to free the stream rings later */
|
|
|
stream_info->free_streams_command =
|
|
|
- xhci_alloc_command(xhci, true, true, mem_flags);
|
|
|
+ xhci_alloc_command_with_ctx(xhci, true, mem_flags);
|
|
|
if (!stream_info->free_streams_command)
|
|
|
goto cleanup_ctx;
|
|
|
|
|
@@ -1736,6 +1736,26 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
|
|
|
return command;
|
|
|
}
|
|
|
|
|
|
+struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci,
|
|
|
+ bool allocate_completion, gfp_t mem_flags)
|
|
|
+{
|
|
|
+ struct xhci_command *command;
|
|
|
+
|
|
|
+ command = xhci_alloc_command(xhci, false, allocate_completion,
|
|
|
+ mem_flags);
|
|
|
+ if (!command)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ command->in_ctx = xhci_alloc_container_ctx(xhci, XHCI_CTX_TYPE_INPUT,
|
|
|
+ mem_flags);
|
|
|
+ if (!command->in_ctx) {
|
|
|
+ kfree(command->completion);
|
|
|
+ kfree(command);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ return command;
|
|
|
+}
|
|
|
+
|
|
|
void xhci_urb_free_priv(struct urb_priv *urb_priv)
|
|
|
{
|
|
|
kfree(urb_priv);
|
|
@@ -2409,7 +2429,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
|
|
|
xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring);
|
|
|
xhci_dbg_cmd_ptrs(xhci);
|
|
|
|
|
|
- xhci->lpm_command = xhci_alloc_command(xhci, true, true, flags);
|
|
|
+ xhci->lpm_command = xhci_alloc_command_with_ctx(xhci, true, flags);
|
|
|
if (!xhci->lpm_command)
|
|
|
goto fail;
|
|
|
|