diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-11-13 06:57:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@kvm.kroah.org> | 2008-12-01 01:24:02 -0500 |
commit | 9ac36da3f8bc646a628bd09326e090defc8b7940 (patch) | |
tree | 0e14a03139f7f02fa08f6d60f0589c25c4c4fe50 /drivers/usb | |
parent | 0a99e8ac430a27825bd055719765fd0d65cd797f (diff) |
USB: fsl_qe_udc: Report disconnect before unbinding
Gadgets disable endpoints in their disconnect callbacks, so
we must call disconnect before unbinding. This also fixes
muram memory leak, since we free muram in the qe_ep_disable().
But mainly the patch fixes following badness:
root@b1:~# insmod fsl_qe_udc.ko
fsl_qe_udc: Freescale QE/CPM USB Device Controller driver, 1.0
fsl_qe_udc e01006c0.usb: QE USB controller initialized as device
root@b1:~# insmod g_ether.ko
g_ether gadget: using random self ethernet address
g_ether gadget: using random host ethernet address
usb0: MAC be:2d:3c:fa:be:f0
usb0: HOST MAC 62:b8:6a:df:38:66
g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
g_ether gadget: g_ether ready
fsl_qe_udc e01006c0.usb: fsl_qe_udc bind to driver g_ether
g_ether gadget: high speed config #1: CDC Ethernet (ECM)
root@b1:~# rmmod g_ether.ko
------------[ cut here ]------------
Badness at drivers/usb/gadget/composite.c:871
[...]
NIP [d10c1374] composite_unbind+0x24/0x15c [g_ether]
LR [d10a82f4] usb_gadget_unregister_driver+0x128/0x168 [fsl_qe_udc]
Call Trace:
[cfb93e80] [cfb1f3a0] 0xcfb1f3a0 (unreliable)
[cfb93eb0] [d10a82f4] usb_gadget_unregister_driver+0x128/0x168 [fsl_qe_udc]
[cfb93ed0] [d10c2a3c] usb_composite_unregister+0x3c/0x4c [g_ether]
[cfb93ee0] [c006bde0] sys_delete_module+0x130/0x19c
[cfb93f40] [c00142d8] ret_from_syscall+0x0/0x38
[...]
fsl_qe_udc e01006c0.usb: unregistered gadget driver 'g_ether'
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/fsl_qe_udc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 1fe8b44787b3..b3408ff39fba 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -2363,6 +2363,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
2363 | nuke(loop_ep, -ESHUTDOWN); | 2363 | nuke(loop_ep, -ESHUTDOWN); |
2364 | spin_unlock_irqrestore(&udc_controller->lock, flags); | 2364 | spin_unlock_irqrestore(&udc_controller->lock, flags); |
2365 | 2365 | ||
2366 | /* report disconnect; the controller is already quiesced */ | ||
2367 | driver->disconnect(&udc_controller->gadget); | ||
2368 | |||
2366 | /* unbind gadget and unhook driver. */ | 2369 | /* unbind gadget and unhook driver. */ |
2367 | driver->unbind(&udc_controller->gadget); | 2370 | driver->unbind(&udc_controller->gadget); |
2368 | udc_controller->gadget.dev.driver = NULL; | 2371 | udc_controller->gadget.dev.driver = NULL; |