diff options
| author | Grazvydas Ignotas <notasas@gmail.com> | 2012-01-12 17:22:45 +0400 | 
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2012-01-24 17:43:16 +0400 | 
| commit | 24307caef4950e42e7875a901856ed8816c4679c (patch) | |
| tree | ce5ea1d2ba54d2dd3afd80f830375362be8bd84f /lib/dump_stack.c | |
| parent | 4b5203f1883e2dd49273e9f91235c36a0708aad1 (diff) | |
| download | linux-24307caef4950e42e7875a901856ed8816c4679c.tar.xz | |
usb: musb: fix shutdown while usb gadget is in use
If we shutdown without stopping the gadget first or removing the cable,
gadget manages to configure itself again:
root@pandora /root# poweroff
The system is going down NOW!
Requesting system poweroff
[   47.714385] musb-hm halted.
[   48.120697]  gadget: suspend
[   48.123748]  gadget: reset config
[   48.127227]  gadget: ecm deactivated
[   48.130981] usb0: gether_disconnect
[   48.281799]  gadget: high-speed config #1: CDC Ethernet (ECM)
[   48.287872]  gadget: init ecm
[   48.290985]  gadget: notify connect false
[   48.295288]  gadget: notify speed 425984000
This is not only unwanted, it's also happening on half-unitialized
state, after musb_shutdown() has returned, which sometimes causes
hardware to fail to work after reboot. Let's better properly stop
gadget on shutdown too.
This patch moves musb_gadget_cleanup out of musb_free(), which has 2
callsites: probe error path and musb_remove. On probe error path it was
superflous since musb_gadget_cleanup is called explicitly there, and
musb_remove() calls musb_shutdown(), so cleanup will get called as before.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'lib/dump_stack.c')
0 files changed, 0 insertions, 0 deletions
