diff options
author | Jani Nikula <jani.nikula@intel.com> | 2018-11-02 09:00:55 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2018-11-02 09:01:28 +0200 |
commit | 7a085c3aad94cce7e11031c6800e41668418ae4c (patch) | |
tree | b3474f8bd622f87ad39227057f9de60959c8bd95 /drivers/usb/core/message.c | |
parent | 18cde299df33ff73908f7e5dcebf321fb79ed36c (diff) | |
parent | f9885ef875e9160454392f85159163674159c51f (diff) | |
download | linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.tar.gz linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.tar.bz2 linux-stable-7a085c3aad94cce7e11031c6800e41668418ae4c.zip |
Merge drm/drm-next into drm-intel-next-queued
Although there's nothing crucial missing, it's been a long time since
the last backmerge. Catch up with drm-next.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r-- | drivers/usb/core/message.c | 11 |
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, * is submitted that needs that bandwidth. Some other operating systems * allocate bandwidth early, when a configuration is chosen. * + * xHCI reserves bandwidth and configures the alternate setting in + * usb_hcd_alloc_bandwidth(). If it fails the original interface altsetting + * may be disabled. Drivers cannot rely on any particular alternate + * setting being in effect after a failure. + * * This call is synchronous, and may not be used in an interrupt context. * Also, drivers must not change altsettings while urbs are scheduled for * 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) alternate); return -EINVAL; } + /* + * usb3 hosts configure the interface in usb_hcd_alloc_bandwidth, + * including freeing dropped endpoint ring buffers. + * Make sure the interface endpoints are flushed before that + */ + usb_disable_interface(dev, iface, false); /* Make sure we have enough bandwidth for this alternate interface. * Remove the current alt setting and add the new alt setting. |