提交 b11069f5 编写于 作者: S Sarah Sharp 提交者: Greg Kroah-Hartman

USB: xhci: Use GFP_ATOMIC while holding spinlocks.

The xHCI functions to queue an URB onto the hardware rings must be called
with the xhci spinlock held.  Those functions will allocate memory, and
take a gfp_t memory flags argument.  We must pass them the GFP_ATOMIC
flag, since we don't want the memory allocation to attempt to sleep while
waiting for more memory to become available.
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a1587d97
......@@ -601,10 +601,13 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
goto exit;
}
if (usb_endpoint_xfer_control(&urb->ep->desc))
ret = xhci_queue_ctrl_tx(xhci, mem_flags, urb,
/* We have a spinlock and interrupts disabled, so we must pass
* atomic context to this function, which may allocate memory.
*/
ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
slot_id, ep_index);
else if (usb_endpoint_xfer_bulk(&urb->ep->desc))
ret = xhci_queue_bulk_tx(xhci, mem_flags, urb,
ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
slot_id, ep_index);
else
ret = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册