linux/drivers/usb/core
Alan Stern 36caff5d79 USB: fix endpoint-disabling for failed config changes
This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller.  The controller needs to
be told to disable the endpoints that have been enabled for the new
config.  The existing code does this, but before storing the
information about which endpoints were enabled!  As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.

The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config.  If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble.  The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Matthias Schniedermeyer <ms@citd.de>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-11 18:06:48 -08:00
..
buffer.c USB: Core: Fix minor coding style issues 2011-01-22 19:35:39 -08:00
config.c usb: Fail a get config when the port is powered off. 2012-09-10 13:04:01 -07:00
devices.c USB: hub_for_each_child should skip unconnected ports 2012-10-24 14:51:21 -07:00
devio.c usbdevfs: Fix broken scatter-gather transfer 2012-10-17 13:41:34 -07:00
driver.c USB: Enable LPM after a failed probe. 2012-10-08 11:47:40 -07:00
endpoint.c usb/endpoint: Set release callback in the struct device_type instead of in the device itself directly 2012-08-20 14:38:08 -07:00
file.c USB: rename the usb misc class from "usb" to "usbmisc" 2012-06-13 15:37:13 -07:00
generic.c USB: accept RNDIS configs if there's no alternative 2010-08-10 14:35:43 -07:00
hcd-pci.c USB: add NO_D3_DURING_SLEEP flag and revert 151b612847 2012-06-13 13:11:39 -07:00
hcd.c USB: speed up usb_bus_resume() 2012-10-24 14:51:22 -07:00
hub.c USB: remove iteration limit in hub_tt_work() 2012-10-31 12:48:07 -07:00
Kconfig USB: remove CONFIG_EXPERIMENTAL dependancies 2012-09-17 23:00:15 -07:00
Makefile usb: Bind devices to ACPI devices when possible 2012-05-11 17:06:13 -07:00
message.c USB: fix endpoint-disabling for failed config changes 2012-11-11 18:06:48 -08:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
quirks.c Merge 3.6-rc6 into usb-next 2012-09-16 20:42:46 -07:00
sysfs.c usb: convert USB_QUIRK_RESET_MORPHS to USB_QUIRK_RESET 2012-08-20 14:38:08 -07:00
urb.c USB: update documentation for URB_ISO_ASAP 2012-10-22 11:10:24 -07:00
usb-acpi.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-10-08 07:14:06 +09:00
usb.c USB: use bus_to_hdc instead of container_of 2012-10-24 14:40:50 -07:00
usb.h usb/acpi: Store info on device removability. 2012-09-10 13:04:01 -07:00