aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-23 20:50:35 -0500
commit5ce1a70e2f00f0bce0cab57f798ca354b9496169 (patch)
tree6e80200536b7a3576fd71ff2c7135ffe87dc858e /drivers/usb
parent9d3cae26acb471d5954cfdc25d1438b32060babe (diff)
parentef53d16cded7f89b3843b7a96970dab897843ea5 (diff)
Merge branch 'akpm' (more incoming from Andrew)
Merge second patch-bomb from Andrew Morton: - A little DM fix - the MM queue * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (154 commits) ksm: allocate roots when needed mm: cleanup "swapcache" in do_swap_page mm,ksm: swapoff might need to copy mm,ksm: FOLL_MIGRATION do migration_entry_wait ksm: shrink 32-bit rmap_item back to 32 bytes ksm: treat unstable nid like in stable tree ksm: add some comments tmpfs: fix mempolicy object leaks tmpfs: fix use-after-free of mempolicy object mm/fadvise.c: drain all pagevecs if POSIX_FADV_DONTNEED fails to discard all pages mm: export mmu notifier invalidates mm: accelerate mm_populate() treatment of THP pages mm: use long type for page counts in mm_populate() and get_user_pages() mm: accurately document nr_free_*_pages functions with code comments HWPOISON: change order of error_states[]'s elements HWPOISON: fix misjudgement of page_action() for errors on mlocked pages memcg: stop warning on memcg_propagate_kmem net: change type of virtio_chan->p9_max_pages vmscan: change type of vm_total_pages to unsigned long fs/nfsd: change type of max_delegations, nfsd_drc_max_mem and nfsd_drc_mem_used ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 1775ad471edd..5480352f984d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5177,6 +5177,7 @@ int usb_reset_device(struct usb_device *udev)
5177{ 5177{
5178 int ret; 5178 int ret;
5179 int i; 5179 int i;
5180 unsigned int noio_flag;
5180 struct usb_host_config *config = udev->actconfig; 5181 struct usb_host_config *config = udev->actconfig;
5181 5182
5182 if (udev->state == USB_STATE_NOTATTACHED || 5183 if (udev->state == USB_STATE_NOTATTACHED ||
@@ -5186,6 +5187,17 @@ int usb_reset_device(struct usb_device *udev)
5186 return -EINVAL; 5187 return -EINVAL;
5187 } 5188 }
5188 5189
5190 /*
5191 * Don't allocate memory with GFP_KERNEL in current
5192 * context to avoid possible deadlock if usb mass
5193 * storage interface or usbnet interface(iSCSI case)
5194 * is included in current configuration. The easist
5195 * approach is to do it for every device reset,
5196 * because the device 'memalloc_noio' flag may have
5197 * not been set before reseting the usb device.
5198 */
5199 noio_flag = memalloc_noio_save();
5200
5189 /* Prevent autosuspend during the reset */ 5201 /* Prevent autosuspend during the reset */
5190 usb_autoresume_device(udev); 5202 usb_autoresume_device(udev);
5191 5203
@@ -5230,6 +5242,7 @@ int usb_reset_device(struct usb_device *udev)
5230 } 5242 }
5231 5243
5232 usb_autosuspend_device(udev); 5244 usb_autosuspend_device(udev);
5245 memalloc_noio_restore(noio_flag);
5233 return ret; 5246 return ret;
5234} 5247}
5235EXPORT_SYMBOL_GPL(usb_reset_device); 5248EXPORT_SYMBOL_GPL(usb_reset_device);