linux_dsm_epyc7002/drivers/usb/musb
Vikram Pandita 712d8efafb usb: musb: fix pm_runtime calls while atomic
musb pm_runtime_get_sync call happens in intrrupt context on cable attach case
That can result in re-enabling the interrupts and cause side affects.

So move the code to a work queue.

Following is the error path hit on cable attach:

BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:802
in_atomic(): 0, irqs_disabled(): 0, pid: 18, name: irq/378-twl6030

Backtrace:
[<c00520f0>] (dump_backtrace+0x0/0x110) from [<c054f454>] (dump_stack+0x18/0x1c)
[<c054f43c>] (dump_stack+0x0/0x1c) from [<c007f59c>] (__might_sleep+0x130/0x134)
[<c007f46c>] (__might_sleep+0x0/0x134) from [<c02c2794>] (__pm_runtime_resume+0x94/0x98)
[<c02c2700>] (__pm_runtime_resume+0x0/0x98) from [<c033e7e4>] (musb_otg_notifications+0x9c/0x164)
[<c033e748>] (musb_otg_notifications+0x0/0x164) from [<c00b3df0>] (notifier_call_chain+0x4c/0x8c)
[<c00b3da4>] (notifier_call_chain+0x0/0x8c) from [<c00b44a8>] (__atomic_notifier_call_chain+0x40/0x54)
[<c00b4468>] (__atomic_notifier_call_chain+0x0/0x54) from [<c00b44dc>] (atomic_notifier_call_chain+0x20/0x28)
[<c00b44bc>] (atomic_notifier_call_chain+0x0/0x28) from [<c033f124>] (twl6030_usb_irq+0xc8/0xdc)
[<c033f05c>] (twl6030_usb_irq+0x0/0xdc) from [<c00d79f8>] (irq_thread_fn+0x24/0x40)
[<c00d79d4>] (irq_thread_fn+0x0/0x40) from [<c00d7b64>] (irq_thread+0x150/0x1d8)
[<c00d7a14>] (irq_thread+0x0/0x1d8) from [<c00adf70>] (kthread+0x94/0x98)
[<c00adedc>] (kthread+0x0/0x98) from [<c0094388>] (do_exit+0x0/0x720)

Tested with:
MUSB Device mode: Cold boot / Hot plug
MUSB Host mode: Cold boot / Hot plug

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12 11:51:54 +02:00
..
am35x.c usb: musb: fix compilation breakage introduced by de47725 2011-11-14 11:51:32 -08:00
blackfin.c usb: musb: blackfin: include prefetch head file 2011-08-12 11:52:51 +03:00
blackfin.h usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07:00
cppi_dma.c usb: musb: cppi: fix build errors due to DBG and missing musb variable 2011-08-12 11:52:47 +03:00
cppi_dma.h headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
da8xx.c usb: musb: fix compilation breakage introduced by de47725 2011-11-14 11:51:32 -08:00
davinci.c ARM: gpio: davinci: convert drivers to use asm/gpio.h rather than mach/gpio.h 2011-08-08 14:27:55 +01:00
davinci.h USB: musb: partial DaVinci dm355 support 2009-03-24 16:20:36 -07:00
Kconfig usb: musb: drop ARCH dependency 2011-12-12 11:51:53 +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: musb: allow building USB_MUSB_TUSB6010 as a module 2011-12-12 11:51:42 +02:00
musb_core.h usb: musb: fix pm_runtime calls while atomic 2011-12-12 11:51:54 +02:00
musb_debug.h usb: musb: drop unneeded musb_debug trickery 2011-05-13 14:34:04 +03:00
musb_debugfs.c usb: musb: headers cleanup 2011-12-12 11:51:52 +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_ep0.c usb: musb: headers cleanup 2011-12-12 11:51:52 +02:00
musb_gadget.c usb: musb: headers cleanup 2011-12-12 11:51:52 +02:00
musb_gadget.h usb: musb: gadget: do not poke with gadget's list_head 2011-02-17 21:11:46 +02:00
musb_host.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07: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: allow building USB_MUSB_TUSB6010 as a module 2011-12-12 11:51:42 +02:00
musb_regs.h usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
musb_virthub.c usb: musb: drop a gigantic amount of ifdeferry 2011-07-01 14:31:10 -07: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 pm_runtime calls while atomic 2011-12-12 11:51:54 +02:00
omap2430.h USB: musb: get rid of omap_readl/writel 2010-03-02 14:54:38 -08:00
tusb6010_omap.c usb: musb: tusb6010: fix compilation 2011-08-12 11:52:50 +03:00
tusb6010.c usb: musb: allow building USB_MUSB_TUSB6010 as a module 2011-12-12 11:51:42 +02:00
tusb6010.h USB: musb: Remove my email address from few musb related drivers 2009-04-23 14:15:27 -07:00
ux500_dma.c usb: musb: ux500: optimize DMA callback routine 2011-12-12 11:51:39 +02:00
ux500.c usb: musb: ux500: copy dma mask from platform device to musb device 2011-04-13 11:50:57 +03:00