linux/drivers/usb/cdns3
Pawel Laszczak 58f2fcb3a8 usb: cdnsp: Fix deadlock issue during using NCM gadget
The interrupt service routine registered for the gadget is a primary
handler which mask the interrupt source and a threaded handler which
handles the source of the interrupt. Since the threaded handler is
voluntary threaded, the IRQ-core does not disable bottom halves before
invoke the handler like it does for the forced-threaded handler.

Due to changes in networking it became visible that a network gadget's
completions handler may schedule a softirq which remains unprocessed.
The gadget's completion handler is usually invoked either in hard-IRQ or
soft-IRQ context. In this context it is enough to just raise the softirq
because the softirq itself will be handled once that context is left.
In the case of the voluntary threaded handler, there is nothing that
will process pending softirqs. Which means it remain queued until
another random interrupt (on this CPU) fires and handles it on its exit
path or another thread locks and unlocks a lock with the bh suffix.
Worst case is that the CPU goes idle and the NOHZ complains about
unhandled softirqs.

Disable bottom halves before acquiring the lock (and disabling
interrupts) and enable them after dropping the lock. This ensures that
any pending softirqs will handled right away.

cc: stable@vger.kernel.org
Fixes: 3d82904559 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20231108093125.224963-1-pawell@cadence.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-21 15:29:14 +01:00
..
cdns3-debug.h usb: cdns3: change trace event cdns3_ring() operation 2023-03-09 15:35:03 +01:00
cdns3-ep0.c usb: cdns3: Fixed incorrect gadget state 2021-07-29 14:13:02 +08:00
cdns3-gadget.c Merge 6.5-rc4 into usb-next 2023-07-31 09:36:55 +02:00
cdns3-gadget.h usb: cdns3: allocate TX FIFO size according to composite EP number 2022-05-19 18:14:29 +02:00
cdns3-imx.c usb: cdns3: imx: Rework system PM to avoid duplicated operations 2023-05-29 15:53:48 +01:00
cdns3-pci-wrap.c usb: cdns3: Fix issue with using incorrect PCI device function 2023-03-16 12:43:42 +01:00
cdns3-plat.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
cdns3-starfive.c usb: cdns3: starfive: Convert to platform remove callback returning void 2023-07-25 18:18:52 +02:00
cdns3-ti.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
cdns3-trace.c usb: cdns3: Change file names for cdns3 driver. 2020-12-29 12:36:13 +08:00
cdns3-trace.h usb: cdns3: change some trace event __dynamic_array() to __get_buf() 2023-03-09 15:35:03 +01:00
cdnsp-debug.h usb:cdnsp: remove TRB_FLUSH_ENDPOINT command 2023-10-27 12:56:37 +02:00
cdnsp-ep0.c usb: cdnsp: Fixes error: uninitialized symbol 'len' 2023-04-05 19:55:04 +02:00
cdnsp-gadget.c usb:cdnsp: remove TRB_FLUSH_ENDPOINT command 2023-10-27 12:56:37 +02:00
cdnsp-gadget.h usb:cdnsp: remove TRB_FLUSH_ENDPOINT command 2023-10-27 12:56:37 +02:00
cdnsp-mem.c usb: cdnsp: Fix a NULL pointer dereference in cdnsp_endpoint_init() 2021-12-03 13:57:45 +01:00
cdnsp-pci.c usb: cdns3: Put the cdns set active part outside the spin lock 2023-07-25 17:49:25 +02:00
cdnsp-ring.c usb: cdnsp: Fix deadlock issue during using NCM gadget 2023-11-21 15:29:14 +01:00
cdnsp-trace.c usb: cdnsp: Add tracepoints for CDNSP driver 2020-12-29 12:36:13 +08:00
cdnsp-trace.h usb: cdns3: change some trace event __dynamic_array() to __get_buf() 2023-03-09 15:35:03 +01:00
core.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
core.h usb: cdns3: Modify the return value of cdns_set_active () to void when CONFIG_PM_SLEEP is disabled 2023-10-02 14:25:39 +02:00
drd.c usb: cdns3: Add PHY mode switch to usb2 PHY 2023-07-25 18:22:36 +02:00
drd.h usb: cdns3: add power lost support for system resume 2021-04-12 20:19:20 +08:00
gadget-export.h usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
host-export.h usb: cdns3: Removes xhci_cdns3_suspend_quirk from host-export.h 2020-12-29 12:36:13 +08:00
host.c usb: cdns3: host: fix endless superspeed hub port reset 2022-11-09 12:35:13 +01:00
Kconfig usb: cdns3: Add StarFive JH7110 USB driver 2023-05-29 15:52:11 +01:00
Makefile usb: cdns3: Add StarFive JH7110 USB driver 2023-05-29 15:52:11 +01:00