diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-04-26 11:31:57 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-04-27 04:06:15 -0400 |
commit | 320cd1e750f1bf3e47eb41209dcb2be07264cb76 (patch) | |
tree | 62627ea5423feb10d7ae77e7e52360fa0d572326 | |
parent | 83a787a71e034244a9fd1d5988fe18f226341417 (diff) |
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
8ae8090c82eb407267001f75b3d256b3bd4ae691 (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>
-rw-r--r-- | drivers/usb/gadget/udc-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c index df1bd87232dd..e5e44f8cde9a 100644 --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c | |||
@@ -263,8 +263,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) | |||
263 | 263 | ||
264 | if (udc_is_newstyle(udc)) { | 264 | if (udc_is_newstyle(udc)) { |
265 | udc->driver->disconnect(udc->gadget); | 265 | udc->driver->disconnect(udc->gadget); |
266 | udc->driver->unbind(udc->gadget); | ||
267 | usb_gadget_disconnect(udc->gadget); | 266 | usb_gadget_disconnect(udc->gadget); |
267 | udc->driver->unbind(udc->gadget); | ||
268 | usb_gadget_udc_stop(udc->gadget, udc->driver); | 268 | usb_gadget_udc_stop(udc->gadget, udc->driver); |
269 | } else { | 269 | } else { |
270 | usb_gadget_stop(udc->gadget, udc->driver); | 270 | usb_gadget_stop(udc->gadget, udc->driver); |