linux/drivers/usb
Thinh Nguyen c4e3ef5685 usb: dwc3: gadget: Ignore End Transfer delay on teardown
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-06 16:32:10 +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-11-29 08:56:09 +01:00
chipidea Merge 6.1-rc6 into usb-next 2022-11-21 10:37:10 +01:00
class USB: make devnode() callback in usb_class_driver take a const * 2022-10-20 12:11:56 +02:00
common Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout" 2022-12-28 11:22:30 +01:00
core Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
dwc2 usb: dwc2: power on/off phy for peripheral mode in dual-role mode 2022-12-08 16:50:56 +01:00
dwc3 usb: dwc3: gadget: Ignore End Transfer delay on teardown 2023-01-06 16:32:10 +01:00
early usb: early: xhci-dbc: use console_is_registered() 2022-12-02 11:25:02 +01:00
fotg210 usb: fotg210-udc: fix error return code in fotg210_udc_probe() 2023-01-06 09:12:31 +01:00
gadget treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
host USB/Thunderbolt driver changes for 6.2-rc1 2022-12-16 03:22:53 -08: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 Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08: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: remove extra check in musb_gadget_vbus_draw 2022-12-08 16:44:39 +01:00
phy usb: isp1301-omap: Convert to i2c's .probe_new() 2022-11-22 17:33:27 +01:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-06-21 16:39:03 +02:00
roles Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
serial treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
storage usb: storage: Add check for kcalloc 2022-12-08 16:43:12 +01:00
typec Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
usbip Including fixes from bpf, netfilter and can. 2022-12-21 08:41:32 -08:00
Kconfig usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
Makefile usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
usb-skeleton.c usb: add usb_set_intfdata() documentation 2022-11-29 08:56:09 +01:00