aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 228672f2c4a1..bfa5eda0cc26 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1341,6 +1341,11 @@ void usb_enable_interface(struct usb_device *dev,
1341 * is submitted that needs that bandwidth. Some other operating systems 1341 * is submitted that needs that bandwidth. Some other operating systems
1342 * allocate bandwidth early, when a configuration is chosen. 1342 * allocate bandwidth early, when a configuration is chosen.
1343 * 1343 *
1344 * xHCI reserves bandwidth and configures the alternate setting in
1345 * usb_hcd_alloc_bandwidth(). If it fails the original interface altsetting
1346 * may be disabled. Drivers cannot rely on any particular alternate
1347 * setting being in effect after a failure.
1348 *
1344 * This call is synchronous, and may not be used in an interrupt context. 1349 * This call is synchronous, and may not be used in an interrupt context.
1345 * Also, drivers must not change altsettings while urbs are scheduled for 1350 * Also, drivers must not change altsettings while urbs are scheduled for
1346 * endpoints in that interface; all such urbs must first be completed 1351 * endpoints in that interface; all such urbs must first be completed
@@ -1376,6 +1381,12 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1376 alternate); 1381 alternate);
1377 return -EINVAL; 1382 return -EINVAL;
1378 } 1383 }
1384 /*
1385 * usb3 hosts configure the interface in usb_hcd_alloc_bandwidth,
1386 * including freeing dropped endpoint ring buffers.
1387 * Make sure the interface endpoints are flushed before that
1388 */
1389 usb_disable_interface(dev, iface, false);
1379 1390
1380 /* Make sure we have enough bandwidth for this alternate interface. 1391 /* Make sure we have enough bandwidth for this alternate interface.
1381 * Remove the current alt setting and add the new alt setting. 1392 * Remove the current alt setting and add the new alt setting.