linux-stable/drivers/usb
Thinh Nguyen acbf70d7f9 usb: dwc3: gadget: Ignore End Transfer delay on teardown
commit c4e3ef5685 upstream.

If we delay sending End Transfer for Setup TRB to be prepared, we need
to check if the End Transfer was in preparation for a driver
teardown/soft-disconnect. In those cases, just send the End Transfer
command without delay.

In the case of soft-disconnect, there's a very small chance the command
may not go through immediately. But should it happen, the Setup TRB will
be prepared during the polling of the controller halted state, allowing
the command to go through then.

In the case of disabling endpoint due to reconfiguration (e.g.
set_interface(alt-setting) or usb reset), then it's driven by the host.
Typically the host wouldn't immediately cancel the control request and
send another control transfer to trigger the End Transfer command
timeout.

Fixes: 4db0fbb601 ("usb: dwc3: gadget: Don't delay End Transfer on delayed_status")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/f1617a323e190b9cc408fb8b65456e32b5814113.1670546756.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-12 12:01:55 +01:00
..
atm usb: move from strlcpy with unused retval to strscpy 2022-08-19 11:08:54 +02:00
c67x00 USB: c67x00: remove unnecessary check of res 2022-05-12 11:36:46 +02:00
cdns3 usb: cdnsp: fix lack of ZLP for ep0 2022-12-31 13:33:09 +01:00
chipidea usb: chipidea: fix deadlock in ci_otg_del_timer 2022-11-09 12:34:18 +01:00
class USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
common usb: ulpi: use DEFINE_SHOW_ATTRIBUTE to simplify ulpi_regs 2022-09-27 10:36:54 +02:00
core usb: core: hcd: Fix return value check in usb_hcd_setup_local_mem() 2022-12-31 13:32:41 +01:00
dwc2 usb: dwc2: Remove redundant license text 2022-09-22 15:52:29 +02:00
dwc3 usb: dwc3: gadget: Ignore End Transfer delay on teardown 2023-01-12 12:01:55 +01:00
early usb: early: xhci-dbc: Fix xdbc number parsing 2022-03-15 18:20:34 +01:00
gadget usb: gadget: f_hid: fix refcount leak on error path 2022-12-31 13:32:41 +01:00
host xhci: Prevent infinite loop in transaction errors recovery for streams 2022-12-31 13:33:10 +01:00
image usb/image: fix repeated words in comments 2022-07-27 14:33:53 +02:00
isp1760 usb: isp1760: Fix out-of-bounds array access 2022-05-19 18:10:59 +02:00
misc fbdev: sisfb: use explicitly signed char 2022-10-24 20:28:41 +02:00
mon usb: mon: make mmapped memory read only 2022-09-22 15:52:29 +02:00
mtu3 usb: mtu3: fix failed runtime suspend in host only mode 2022-09-30 13:55:48 +02:00
musb usb: musb: omap2430: Fix probe regression for missing resources 2022-12-31 13:32:39 +01:00
phy USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-06-21 16:39:03 +02:00
roles usb: roles: fix of node refcount leak in usb_role_switch_is_parent() 2022-12-31 13:32:41 +01:00
serial USB: serial: f81534: fix division by zero on line-speed change 2022-12-21 17:48:08 +01:00
storage usb: storage: Add check for kcalloc 2022-12-31 13:32:42 +01:00
typec usb: typec: wusb3801: fix fwnode refcount leak in wusb3801_probe() 2022-12-31 13:32:42 +01:00
usbip usbip: add USBIP_URB_* URB transfer flags 2022-08-31 09:07:53 +02:00
Kconfig
Makefile
usb-skeleton.c