linux-stable/drivers/usb/chipidea
Peter Chen 7368760d1b usb: chipidea: udc: fix sleeping function called from invalid context
The code calls pm_runtime_get_sync with irq disabled, it causes below
warning:

BUG: sleeping function called from invalid context at
wer/runtime.c:1075
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid:
er/u8:1
CPU: 1 PID: 37 Comm: kworker/u8:1 Not tainted
20200304-00181-gbebfd2a5be98 #1588
Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
Workqueue: ci_otg ci_otg_work
[<c010e8bd>] (unwind_backtrace) from [<c010a315>]
1/0x14)
[<c010a315>] (show_stack) from [<c0987d29>]
5/0x94)
[<c0987d29>] (dump_stack) from [<c013e77f>]
+0xeb/0x118)
[<c013e77f>] (___might_sleep) from [<c052fa1d>]
esume+0x75/0x78)
[<c052fa1d>] (__pm_runtime_resume) from [<c0627a33>]
0x23/0x74)
[<c0627a33>] (ci_udc_pullup) from [<c062fb93>]
nect+0x2b/0xcc)
[<c062fb93>] (usb_gadget_connect) from [<c062769d>]
_connect+0x59/0x104)
[<c062769d>] (ci_hdrc_gadget_connect) from [<c062778b>]
ssion+0x43/0x48)
[<c062778b>] (ci_udc_vbus_session) from [<c062f997>]
s_connect+0x17/0x9c)
[<c062f997>] (usb_gadget_vbus_connect) from [<c062634d>]
bd/0x128)
[<c062634d>] (ci_otg_work) from [<c0134719>]
rk+0x149/0x404)
[<c0134719>] (process_one_work) from [<c0134acb>]
0xf7/0x3bc)
[<c0134acb>] (worker_thread) from [<c0139433>]
x118)
[<c0139433>] (kthread) from [<c01010bd>]
(ret_from_fork+0x11/0x34)

Tested-by: Dmitry Osipenko <digetx@gmail.com>
Cc: <stable@vger.kernel.org> #v5.5
Fixes: 72dc8df792 ("usb: chipidea: udc: protect usb interrupt enable")
Reported-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20200316031034.17847-2-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 20:24:28 +01:00
..
bits.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci.h usb: chipidea: handle single role for usb role class 2020-01-22 07:54:26 +01:00
ci_hdrc_imx.c usb: chipidea: imx: pinctrl for HSIC is optional 2019-11-18 17:40:27 +08:00
ci_hdrc_imx.h usb: chipidea: imx: enable vbus and id wakeup only for OTG events 2019-11-18 16:45:30 +08:00
ci_hdrc_msm.c usb: chipidea: msm: Use device-managed registration API 2019-09-03 15:53:27 +02:00
ci_hdrc_pci.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci_hdrc_tegra.c usb: chipidea: tegra: Stop managing PHY's power 2020-01-09 16:21:58 +01:00
ci_hdrc_usb2.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ci_hdrc_zevio.c USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
core.c usb: chipidea: handle single role for usb role class 2020-01-22 07:54:26 +01:00
debug.c usb: chipidea: debug: create debugfs directory under usb root 2019-11-14 11:14:54 +08:00
host.c usb: chipidea: host: Disable port power only if previously enabled 2019-12-30 20:02:01 +01:00
host.h usb: chipidea: add inline for ci_hdrc_host_driver_init if host is not defined 2020-01-22 07:54:27 +01:00
Kconfig usb: chipidea: tegra: Add USB_TEGRA_PHY to driver's dependencies 2020-01-09 16:21:58 +01:00
Makefile usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
otg.c usb: chipidea: add role switch class support 2019-08-28 10:39:53 +08:00
otg.h usb: chipidea: Prevent unbalanced IRQ disable 2018-09-20 17:04:21 +08:00
otg_fsm.c USB: move many drivers to use DEVICE_ATTR_WO 2018-01-24 08:49:52 +01:00
otg_fsm.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
udc.c usb: chipidea: udc: fix sleeping function called from invalid context 2020-03-17 20:24:28 +01:00
udc.h USB: chipidea: Remove redundant license text 2017-11-07 15:45:01 +01:00
ulpi.c usb: chipidea: Always build ULPI code 2018-07-05 14:22:47 +08:00
usbmisc_imx.c usb: chipidea: imx: enable vbus and id wakeup only for OTG events 2019-11-18 16:45:30 +08:00