diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2010-12-28 16:08:42 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-01-14 18:51:51 -0500 |
commit | a6d940dd759bf240d28624198660ed34582a327b (patch) | |
tree | 4a6ce6ef72bb872a9f0a94933b3d6f749b58538e /drivers | |
parent | 653a39d1f61bdc9f277766736d21d2e9be0391cb (diff) |
xhci: Use GFP_NOIO during device reset.
When xhci_discover_or_reset_device() is called after a host controller
power loss, the virtual device may need to be reallocated. Make sure
xhci_alloc_dev() uses GFP_NOIO. This avoid causing a deadlock by allowing
the kernel to flush pending I/O while reallocating memory for a virtual
device for a USB mass storage device that's holding the backing store for
dirty memory buffers.
This patch should be queued for the 2.6.37 stable tree.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b2c56d15fb42..34cf4e165877 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2431,8 +2431,12 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
2431 | xhci_err(xhci, "Error while assigning device slot ID\n"); | 2431 | xhci_err(xhci, "Error while assigning device slot ID\n"); |
2432 | return 0; | 2432 | return 0; |
2433 | } | 2433 | } |
2434 | /* xhci_alloc_virt_device() does not touch rings; no need to lock */ | 2434 | /* xhci_alloc_virt_device() does not touch rings; no need to lock. |
2435 | if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_KERNEL)) { | 2435 | * Use GFP_NOIO, since this function can be called from |
2436 | * xhci_discover_or_reset_device(), which may be called as part of | ||
2437 | * mass storage driver error handling. | ||
2438 | */ | ||
2439 | if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_NOIO)) { | ||
2436 | /* Disable slot, if we can do it without mem alloc */ | 2440 | /* Disable slot, if we can do it without mem alloc */ |
2437 | xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); | 2441 | xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n"); |
2438 | spin_lock_irqsave(&xhci->lock, flags); | 2442 | spin_lock_irqsave(&xhci->lock, flags); |