kernel_optimize_test/drivers/usb/dwc3
Thinh Nguyen 0e5668ed7b usb: dwc3: gadget: Fix event pending check
commit 7441b273388b9a59d8387a03ffbbca9d5af6348c upstream.

The DWC3_EVENT_PENDING flag is used to protect against invalid call to
top-half interrupt handler, which can occur when there's a delay in
software detection of the interrupt line deassertion.

However, the clearing of this flag was done prior to unmasking the
interrupt line, creating opportunity where the top-half handler can
come. This breaks the serialization and creates a race between the
top-half and bottom-half handler, resulting in losing synchronization
between the controller and the driver when processing events.

To fix this, make sure the clearing of the DWC3_EVENT_PENDING is done at
the end of the bottom-half handler.

Fixes: d325a1de49 ("usb: dwc3: gadget: Prevent losing events in event cache")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/8670aaf1cf52e7d1e6df2a827af2d77263b93b75.1656380429.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-21 21:20:18 +02:00
..
core.c usb: dwc3: core: Only handle soft-reset in DCTL 2022-05-09 09:04:58 +02:00
core.h
debug.h
debugfs.c
drd.c usb: dwc3: Try usb-role-switch first in dwc3_drd_init 2022-05-09 09:04:58 +02:00
dwc3-exynos.c
dwc3-haps.c
dwc3-keystone.c
dwc3-meson-g12a.c
dwc3-of-simple.c
dwc3-omap.c usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm 2022-04-13 21:01:00 +02:00
dwc3-pci.c usb: dwc3: pci: Fix pm_runtime_get_sync() error checking 2022-06-14 18:32:31 +02:00
dwc3-qcom.c
dwc3-st.c
ep0.c
gadget.c usb: dwc3: gadget: Fix event pending check 2022-07-21 21:20:18 +02:00
gadget.h
host.c
io.h
Kconfig
Makefile
trace.c
trace.h
ulpi.c