Commit be3de321 authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman

xhci: Fix sleeping with IRQs disabled in xhci_stop_device()

xhci_stop_device() allocates and issues stop commands for each active endpoint.
This is done with spinlock held and interrupt disabled so we can't sleep during
memory allocation. Use GFP_NOWAIT instead

Regression from commit ddba5cd0
"xhci: Use command structures when queuing commands on the command ring"
for 3.16-rc1

Fixes: ddba5cd0 ("xhci: Use command structures when queuing commands")
Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3d95580
...@@ -287,7 +287,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend) ...@@ -287,7 +287,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue) { if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue) {
struct xhci_command *command; struct xhci_command *command;
command = xhci_alloc_command(xhci, false, false, command = xhci_alloc_command(xhci, false, false,
GFP_NOIO); GFP_NOWAIT);
if (!command) { if (!command) {
spin_unlock_irqrestore(&xhci->lock, flags); spin_unlock_irqrestore(&xhci->lock, flags);
xhci_free_command(xhci, cmd); xhci_free_command(xhci, cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment