kernel-fxtec-pro1x/drivers/usb/core
Alan Stern 80f0cf3947 USB: disable endpoints after unbinding interfaces, not before
This patch (as1430) fixes a bug in usbcore.  When a device
configuration change occurs or a device is removed, the endpoints for
the old config should be completely disabled.  However it turns out
they aren't; this is because usb_unbind_interface() calls
usb_enable_interface() or usb_set_interface() to put interfaces back
in altsetting 0, which re-enables the interfaces' endpoints.

As a result, when a device goes through a config change or is
unconfigured, the ep_in[] and ep_out[] arrays may be left holding old
pointers to usb_host_endpoint structures.  If the device is
deauthorized these structures get freed, and the stale pointers cause
errors when the the device is eventually unplugged.

The solution is to disable the endpoints after unbinding the
interfaces instead of before.  This isn't as large a change as it
sounds, since usb_unbind_interface() disables all the interface's
endpoints anyway before calling the driver's disconnect routine,
unless the driver claims to support "soft" unbind.

This fixes Bugzilla #19192.  Thanks to "Tom" Lei Ming for diagnosing
the underlying cause of the problem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Carsten Sommer <carsten_sommer@ymail.com>
CC: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22 10:22:01 -07:00
..
buffer.c USB: make hcd.h public (drivers dependency) 2010-05-20 13:21:30 -07:00
config.c USB: remove the usb_host_ss_ep_comp structure 2010-05-20 13:21:40 -07:00
devices.c USB: teach "devices" file about Wireless and SuperSpeed USB 2010-10-22 10:21:40 -07:00
devio.c USB-BKL: Convert usb_driver ioctl to unlocked_ioctl 2010-08-10 14:35:35 -07:00
driver.c USB: remove fake "address-of" expressions 2010-08-10 14:35:45 -07:00
endpoint.c USB: core endpoint: Fix Coding Styles 2010-08-10 14:35:34 -07:00
file.c USB: fix bug in initialization of interface minor numbers 2010-09-24 11:05:00 -07:00
generic.c USB: accept RNDIS configs if there's no alternative 2010-08-10 14:35:43 -07:00
hcd-pci.c OHCI: work around for nVidia shutdown problem 2010-10-22 10:21:36 -07:00
hcd.c usb: musb: host: unmap the buffer for PIO data transfers 2010-10-22 10:21:53 -07:00
hub.c USB: core: update comment to match current function name 2010-10-22 10:21:21 -07:00
inode.c USB-BKL: Remove lock_kernel in usbfs update_sb() 2010-08-10 14:35:35 -07:00
Kconfig USB: update Kconfig help text for CONFIG_USB_SUSPEND 2010-09-24 11:05:01 -07:00
Makefile usb: change to new flag variable 2010-10-22 10:21:56 -07:00
message.c USB: disable endpoints after unbinding interfaces, not before 2010-10-22 10:22:01 -07:00
notify.c USB : correct comments in usb/core/notify.c 2008-02-01 14:34:44 -08:00
otg_whitelist.h USB: fix codingstyle issues in drivers/usb/core/*.h 2008-02-01 14:35:07 -08:00
quirks.c USB delay init quirk for logitech Harmony 700-series devices 2010-08-10 14:35:41 -07:00
sysfs.c sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
urb.c USB: output an error message when the pipe type doesn't match the endpoint type 2010-10-22 10:21:27 -07:00
usb.c USB: remove fake "address-of" expressions 2010-08-10 14:35:45 -07:00
usb.h USB: convert to the runtime PM framework 2010-03-02 14:54:12 -08:00