linux-sg2042/drivers/usb/musb
Sebastian Andrzej Siewior 66fadea5b7 usb: musb: only cancel work if it is initialized
Since commit c5340bd14 ("usb: musb: cancel work on removal") the workqueue
is cancelled but then if we bail out before the workqueue is setup we
get this:

|INFO: trying to register non-static key.
|the code is fine but needs lockdep annotation.
|turning off the locking correctness validator.
|CPU: 0 PID: 708 Comm: modprobe Not tainted 3.12.0+ #435
|[<c00867bc>] (lock_acquire+0xf0/0x108) from [<c00529d0>] (flush_work+0x38/0x2ec)
|[<c00529d0>] (flush_work+0x38/0x2ec) from [<c0052d24>] (__cancel_work_timer+0xa0/0x134)
|[<c0052d24>] (__cancel_work_timer+0xa0/0x134) from [<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc])
|[<bf0e4ae4>] (musb_free+0x40/0x60 [musb_hdrc]) from [<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc])
|[<bf0e5364>] (musb_probe+0x678/0xb78 [musb_hdrc]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24)
|[<c0294bf0>] (platform_drv_probe+0x1c/0x24) from [<c0293970>] (driver_probe_device+0x90/0x224)
|[<c0293970>] (driver_probe_device+0x90/0x224) from [<c0291ef0>] (bus_for_each_drv+0x60/0x8c)
|[<c0291ef0>] (bus_for_each_drv+0x60/0x8c) from [<c02938bc>] (device_attach+0x80/0xa4)
|[<c02938bc>] (device_attach+0x80/0xa4) from [<c0292b24>] (bus_probe_device+0x88/0xac)
|[<c0292b24>] (bus_probe_device+0x88/0xac) from [<c0291490>] (device_add+0x388/0x6c8)
|[<c0291490>] (device_add+0x388/0x6c8) from [<c02952a0>] (platform_device_add+0x188/0x22c)
|[<c02952a0>] (platform_device_add+0x188/0x22c) from [<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps])
|[<bf11ea30>] (dsps_probe+0x294/0x394 [musb_dsps]) from [<c0294bf0>] (platform_drv_probe+0x1c/0x24)
|platform musb-hdrc.1.auto: Driver musb-hdrc requests probe deferral
|musb-hdrc musb-hdrc.1.auto: musb_init_controller failed with status -517

This patch moves the init part to earlier part so it can be cleaned as
part of the fail3 label because now it is surrounded by the fail4 label.
Step two is to remove it from musb_free() and add it to the two cleanup
paths (error path and device removal) separately.

Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25 10:54:21 -06:00
..
Kconfig usb: patches for v3.13 2013-10-24 16:18:40 +01:00
Makefile usb: musb dma: add cppi41 dma driver 2013-08-09 17:40:16 +03:00
am35x.c usb: musb: am35x: use SIMPLE_DEV_PM_OPS 2013-10-02 08:21:23 -05:00
blackfin.c usb: musb: blackfin: use SIMPLE_DEV_PM_OPS 2013-10-02 08:21:55 -05:00
blackfin.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
cppi_dma.c usb: musb: dma: merge ->start/stop into create/destroy 2013-07-29 13:53:18 +03:00
cppi_dma.h
da8xx.c usb: musb: use platform_device_register_full() to avoid directly messing with dma masks 2013-10-01 09:31:19 -05:00
davinci.c usb: musb: davinci: fix resources passed to MUSB driver for DM6467 2013-10-01 09:44:01 -05:00
davinci.h usb: musb: davinci: Fix build breakage 2012-06-04 18:29:42 +03:00
musb_am335x.c usb: musb_am335x: Remove redundant of_match_ptr 2013-10-04 09:25:11 -05:00
musb_core.c usb: musb: only cancel work if it is initialized 2013-11-25 10:54:21 -06:00
musb_core.h Merge 3.12-rc6 into usb-next. 2013-10-19 13:19:07 -07:00
musb_cppi41.c usb: musb: musb_cppi41: handle pre-mature TX complete interrupt 2013-11-25 10:54:14 -06: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: remove use of __devinit 2012-11-21 13:27:16 -08:00
musb_dma.h usb: musb dma: add cppi41 dma driver 2013-08-09 17:40:16 +03:00
musb_dsps.c usb: patches for v3.13 2013-10-24 16:18:40 +01:00
musb_gadget.c usb: fix musb gadget to enable OTG mode conditionally 2013-11-25 10:25:58 -06:00
musb_gadget.h usb: musb: add Kconfig options for HOST, GAGDET or DUAL_ROLE modes 2013-05-28 19:22:23 +03:00
musb_gadget_ep0.c usb: musb: gadget: read ep0 fifo only if rxcount is non zero 2013-04-02 11:42:50 +03:00
musb_host.c usb: Remove unnecessary semicolons 2013-10-11 16:26:46 -07:00
musb_host.h usb: patches for v3.11 merge window 2013-06-12 14:44:13 -07:00
musb_io.h usb: musb: use io{read,write}*_rep accessors 2012-12-17 17:15:13 -08:00
musb_regs.h usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
musb_virthub.c usb: patches for v3.13 2013-10-24 16:18:40 +01:00
musbhsdma.c usb: musb: dma: merge ->start/stop into create/destroy 2013-07-29 13:53:18 +03:00
musbhsdma.h usb: musb: remove generic_interrupt 2012-11-06 15:32:13 +02:00
omap2430.c usb: patches for v3.13 2013-10-24 16:18:40 +01:00
omap2430.h usb: start using the control module driver 2013-01-25 12:27:24 +02:00
tusb6010.c usb: musb: use platform_device_register_full() to avoid directly messing with dma masks 2013-10-01 09:31:19 -05:00
tusb6010.h
tusb6010_omap.c usb: musb: dma: merge ->start/stop into create/destroy 2013-07-29 13:53:18 +03:00
ux500.c ARM: SoC DT updates for 3.13 2013-11-11 17:34:56 +09:00
ux500_dma.c usb: musb: ux500: Add check for NULL board data 2013-08-27 15:05:39 -05:00