linux/drivers/usb
Sebastian Andrzej Siewior 328faee6d4 usb: dwc3: gadget: Let the interrupt handler disable bottom halves.
commit 84918a89d6 upstream.

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.

Link: https://lkml.kernel.org/r/c2a64979-73d1-2c22-e048-c275c9f81558@samsung.com
Fixes: e5f68b4a3e ("Revert "usb: dwc3: gadget: remove unnecessary _irqsave()"")
Cc: stable <stable@kernel.org>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/Yg/YPejVQH3KkRVd@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:42:55 +01:00
..
atm
c67x00
cdns3 usb: cdns3: fix race condition before setting doorbell 2021-10-06 15:55:46 +02:00
chipidea usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe 2021-12-01 09:18:59 +01:00
class USB: cdc-acm: fix break reporting 2021-10-13 10:04:23 +02:00
common usb: ulpi: Call of_node_put correctly 2022-02-16 12:54:28 +01:00
core USB: core: Fix hang in usb_kill_urb by adding memory barriers 2022-02-01 17:25:41 +01:00
dwc2 usb: dwc2: drd: fix soft connect when gadget is unconfigured 2022-03-02 11:42:55 +01:00
dwc3 usb: dwc3: gadget: Let the interrupt handler disable bottom halves. 2022-03-02 11:42:55 +01:00
early Revert "usb: early: convert to readl_poll_timeout_atomic()" 2021-12-22 09:30:56 +01:00
gadget USB: gadget: validate endpoint index for xilinx udc 2022-03-02 11:42:54 +01:00
host usb: xhci-plat: fix crash when suspend if remote wake enable 2022-02-01 17:25:41 +01:00
image
isp1760
misc usb: ftdi-elan: fix memory leak on device disconnect 2022-01-27 10:53:58 +01:00
mon
mtu3 usb: mtu3: fix interval value for intr and isoc 2022-01-11 15:25:02 +01:00
musb usb: musb: tusb6010: check return value after calling platform_get_resource() 2021-11-26 10:39:08 +01:00
phy usb: phy: tahvo: add IRQ check 2021-09-15 09:50:40 +02:00
renesas_usbhs usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() 2021-07-28 14:35:44 +02:00
roles usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode() 2021-05-14 09:49:55 +02:00
serial USB: serial: option: add Telit LE910R1 compositions 2022-03-02 11:42:55 +01:00
storage usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge 2022-02-01 17:25:41 +01:00
typec ucsi_ccg: Check DEV_INT bit only when starting CCG4 2022-02-01 17:25:41 +01:00
usbip usbip:vhci_hcd USB port can get stuck in the disabled state 2021-09-18 13:40:33 +02:00
Kconfig
Makefile
usb-skeleton.c