]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/usb/host/xhci.c
Merge branch 'for-2.6.38' of git://linux-nfs.org/~bfields/linux
[mv-sheeva.git] / drivers / usb / host / xhci.c
index b2c56d15fb42ddb9119a375afe01de511c6a165e..34cf4e1658773d870fc857c1338e4fe01df3af02 100644 (file)
@@ -2431,8 +2431,12 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
                xhci_err(xhci, "Error while assigning device slot ID\n");
                return 0;
        }
-       /* xhci_alloc_virt_device() does not touch rings; no need to lock */
-       if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_KERNEL)) {
+       /* xhci_alloc_virt_device() does not touch rings; no need to lock.
+        * Use GFP_NOIO, since this function can be called from
+        * xhci_discover_or_reset_device(), which may be called as part of
+        * mass storage driver error handling.
+        */
+       if (!xhci_alloc_virt_device(xhci, xhci->slot_id, udev, GFP_NOIO)) {
                /* Disable slot, if we can do it without mem alloc */
                xhci_warn(xhci, "Could not allocate xHCI USB device data structures\n");
                spin_lock_irqsave(&xhci->lock, flags);