]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: udc-core: fix incompatibility with dummy-hcd
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 26 Apr 2012 15:31:57 +0000 (11:31 -0400)
committerFelipe Balbi <balbi@ti.com>
Fri, 27 Apr 2012 08:06:15 +0000 (11:06 +0300)
commit250b84c3f7386afa311c1347f58b8b57f212518e
tree62627ea5423feb10d7ae77e7e52360fa0d572326
parent65b0e3df3a6e5a2250897e9a3745cdd89f1cd4e0
usb: gadget: udc-core: fix incompatibility with dummy-hcd

This patch (as1548) fixes a recently-introduced incompatibility
between the UDC core and the dummy-hcd driver.  Commit
9112a1dfc4a4b11eefac0e40af751e6211655488 (usb: gadget: udc-core: fix
asymmetric calls in remove_driver) moved the usb_gadget_udc_stop()
call in usb_gadget_remove_driver() below the usb_gadget_disconnect()
call.

As a result, usb_gadget_disconnect() gets called at a time when the
gadget driver believes it has been unbound but dummy-hcd believes
it has not.  A nasty error ensues when dummy-hcd calls the gadget
driver's disconnect method a second time.

To fix the problem, this patch moves the gadget driver's unbind
notification after the usb_gadget_disconnect() call.  Now nothing
happens between the two unbind notifications, so nothing goes wrong.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c