diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-07-27 15:03:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-28 17:31:11 -0400 |
commit | b11069f5f6ce6e359f853e908b0917303fcdec8f (patch) | |
tree | 15157b9caf00f8214daa17f4b8445287b7b44e09 /drivers/usb/host/xhci-hcd.c | |
parent | a1587d97ce3e53816c88b513a2038f6c5e5babd7 (diff) |
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: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-hcd.c')
-rw-r--r-- | drivers/usb/host/xhci-hcd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index 1c5901ad6eb8..ff99365cae42 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c | |||
@@ -601,10 +601,13 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags) | |||
601 | goto exit; | 601 | goto exit; |
602 | } | 602 | } |
603 | if (usb_endpoint_xfer_control(&urb->ep->desc)) | 603 | if (usb_endpoint_xfer_control(&urb->ep->desc)) |
604 | ret = xhci_queue_ctrl_tx(xhci, mem_flags, urb, | 604 | /* We have a spinlock and interrupts disabled, so we must pass |
605 | * atomic context to this function, which may allocate memory. | ||
606 | */ | ||
607 | ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb, | ||
605 | slot_id, ep_index); | 608 | slot_id, ep_index); |
606 | else if (usb_endpoint_xfer_bulk(&urb->ep->desc)) | 609 | else if (usb_endpoint_xfer_bulk(&urb->ep->desc)) |
607 | ret = xhci_queue_bulk_tx(xhci, mem_flags, urb, | 610 | ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb, |
608 | slot_id, ep_index); | 611 | slot_id, ep_index); |
609 | else | 612 | else |
610 | ret = -EINVAL; | 613 | ret = -EINVAL; |