linux/drivers/usb/musb
Vladimir Zapolskiy afb76df140 usb: musb: fix oops on omap2430 module unload
This change prevents runtime suspend and resume actual execution, if
omap2430 controller driver is loaded after musb-hdrc, and therefore the
controller isn't initialized properly.

The problem is reproducible with 3.1.y and 3.2 kernels.

Kernel configuration of musb:

  % cat .config | egrep 'MUSB|GADGET'
  CONFIG_USB_MUSB_HDRC=y
  # CONFIG_USB_MUSB_TUSB6010 is not set
  CONFIG_USB_MUSB_OMAP2PLUS=m
  # CONFIG_USB_MUSB_AM35X is not set
  CONFIG_MUSB_PIO_ONLY=y
  CONFIG_USB_GADGET=y
  # CONFIG_USB_GADGET_DEBUG is not set
  # CONFIG_USB_GADGET_DEBUG_FILES is not set
  # CONFIG_USB_GADGET_DEBUG_FS is not set
  CONFIG_USB_GADGET_VBUS_DRAW=2
  CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
  CONFIG_USB_GADGET_MUSB_HDRC=m
  CONFIG_USB_GADGET_DUALSPEED=y
  CONFIG_USB_GADGETFS=m
  # CONFIG_USB_MIDI_GADGET is not set

Fixes the following oops on module unloading:

  Unable to handle kernel NULL pointer dereference at virtual address 00000220
  ----8<----
  [<bf162088>] (omap2430_runtime_resume+0x24/0x54 [omap2430]) from [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50)
  [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50) from [<c0031a24>] (_od_runtime_resume+0x28/0x2c)
  [<c0031a24>] (_od_runtime_resume+0x28/0x2c) from [<c0306cb0>] (__rpm_callback+0x60/0xa0)
  [<c0306cb0>] (__rpm_callback+0x60/0xa0) from [<c0307f2c>] (rpm_resume+0x3fc/0x6e4)
  [<c0307f2c>] (rpm_resume+0x3fc/0x6e4) from [<c030851c>] (__pm_runtime_resume+0x5c/0x90)
  [<c030851c>] (__pm_runtime_resume+0x5c/0x90) from [<c02fd0dc>] (__device_release_driver+0x2c/0xd0)
  [<c02fd0dc>] (__device_release_driver+0x2c/0xd0) from [<c02fda18>] (driver_detach+0xe8/0xf4)
  [<c02fda18>] (driver_detach+0xe8/0xf4) from [<c02fcf88>] (bus_remove_driver+0xa0/0x104)
  [<c02fcf88>] (bus_remove_driver+0xa0/0x104) from [<c02fde54>] (driver_unregister+0x60/0x80)
  [<c02fde54>] (driver_unregister+0x60/0x80) from [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20)
  [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20) from [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430])
  [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430]) from [<c007d8bc>] (sys_delete_module+0x1f4/0x264)
  [<c007d8bc>] (sys_delete_module+0x1f4/0x264) from [<c000f000>] (ret_fast_syscall+0x0/0x30)

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@nokia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org # 3.1
Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-04-10 19:11:43 +03:00
..
am35x.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
blackfin.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
blackfin.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
cppi_dma.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
cppi_dma.h headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
da8xx.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
davinci.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
davinci.h USB: musb: partial DaVinci dm355 support 2009-03-24 16:20:36 -07:00
Kconfig usb: musb: cleanup kconfig 2011-12-20 14:01:38 +02:00
Makefile usb: musb: use a Kconfig choice to pick the right DMA method 2011-12-12 11:51:41 +02:00
musb_core.c usb: core: hcd: make hcd->irq unsigned 2012-03-01 09:31:22 -08:00
musb_core.h usb: otg: Rename otg_transceiver to usb_phy 2012-02-13 13:34:36 +02:00
musb_debug.h usb: musb: remove extern qualifier from musb_debug.h header 2011-12-21 13:21:02 +02:00
musb_debugfs.c usb: musb: debugfs: fix error check 2012-02-01 11:02:46 +02:00
musb_dma.h usb: musb: introduce api for dma code to check compatibility with usb request 2011-02-01 10:41:30 +02:00
musb_gadget.c usb: core: hcd: make hcd->irq unsigned 2012-03-01 09:31:22 -08:00
musb_gadget.h usb: musb: gadget: do not poke with gadget's list_head 2011-02-17 21:11:46 +02:00
musb_gadget_ep0.c usb: musb: headers cleanup 2011-12-12 11:51:52 +02:00
musb_host.c usb: musb: fix reset issue with full speed device 2011-12-14 09:32:51 +02:00
musb_host.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
musb_io.h usb: musb: fix a build error on mips 2012-02-03 09:29:13 +02:00
musb_regs.h usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
musb_virthub.c usb: musb: Start using struct usb_otg 2012-02-13 13:52:54 +02:00
musbhsdma.c USB: irq: Remove IRQF_DISABLED 2011-09-18 01:39:36 -07:00
musbhsdma.h Merge branches 'devel-cleanup', 'devel-board', 'devel-early-init' and 'devel-ti816x' into omap-for-linus 2011-02-16 11:32:38 -08:00
omap2430.c usb: musb: fix oops on omap2430 module unload 2012-04-10 19:11:43 +03:00
omap2430.h USB: musb: get rid of omap_readl/writel 2010-03-02 14:54:38 -08:00
tusb6010.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
tusb6010.h USB: musb: Remove my email address from few musb related drivers 2009-04-23 14:15:27 -07:00
tusb6010_omap.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
ux500.c Here we have a big rework done by Heikki Krogerus (thanks) which 2012-03-01 08:45:33 -08:00
ux500_dma.c dmaengine/dma_slave: introduce inline wrappers 2012-03-21 19:20:22 +05:30