linux/drivers/usb
Grazvydas Ignotas 24307caef4 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>
2012-01-24 15:43:16 +02:00
..
atm module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
c67x00 usb: convert drivers/usb/* to use module_platform_driver() 2011-11-28 06:48:32 +09:00
class Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
core module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
dwc3 usb: dwc3: ep0: fix compile warning 2012-01-24 15:42:25 +02:00
early USB: EHCI: Support controllers with big endian capability regs 2011-05-03 11:43:21 -07:00
gadget usb: gadget: f_mass_storage: Use "bool" instead of "int" in fsg_module_parameters 2012-01-24 15:43:13 +02:00
host Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2012-01-17 10:49:06 -08:00
image USB: convert drivers/usb/* to use module_usb_driver() 2011-11-18 09:34:02 -08:00
misc module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
mon usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
musb usb: musb: fix shutdown while usb gadget is in use 2012-01-24 15:43:16 +02:00
otg drivers: usb: otg: Fix dependencies for some OTG drivers 2012-01-24 15:43:08 +02:00
renesas_usbhs usb: renesas: silence uninitialized variable report in usbhsg_recip_run_handle() 2012-01-24 15:43:06 +02:00
serial module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
storage Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
wusbcore Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
Kconfig USB: Add Samsung Exynos OHCI diver 2011-12-23 11:21:56 +09:00
Makefile USB: OTG should be linked before Host 2011-11-26 19:58:47 -08:00
README
usb-common.c usb: Provide usb_speed_string() function 2011-09-18 01:29:04 -07:00
usb-skeleton.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("khubd").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.