android_kernel_xiaomi_sm8350/drivers/usb/usbip
Simon Holesch bf9502a1ae usbip: Don't submit special requests twice
[ Upstream commit 8b6b386f9aa936ed0c190446c71cf59d4a507690 ]

Skip submitting URBs, when identical requests were already sent in
tweak_special_requests(). Instead call the completion handler directly
to return the result of the URB.

Even though submitting those requests twice should be harmless, there
are USB devices that react poorly to some duplicated requests.

One example is the ChipIdea controller implementation in U-Boot: The
second SET_CONFIGURATION request makes U-Boot disable and re-enable all
endpoints. Re-enabling an endpoint in the ChipIdea controller, however,
was broken until U-Boot commit b272c8792502 ("usb: ci: Fix gadget
reinit").

Signed-off-by: Simon Holesch <simon@holesch.de>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: Hongren Zheng <i@zenithal.me>
Tested-by: Hongren Zheng <i@zenithal.me>
Link: https://lore.kernel.org/r/20240519141922.171460-1-simon@holesch.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:03:50 +02:00
..
Kconfig USBIP: add config dependency for SGL_ALLOC 2019-11-29 10:10:20 +01:00
Makefile
stub_dev.c USB: usbip: fix stub_dev hub disconnect 2023-11-20 10:30:14 +01:00
stub_main.c
stub_rx.c usbip: Don't submit special requests twice 2024-09-12 11:03:50 +02:00
stub_tx.c
stub.h
usbip_common.c
usbip_common.h usbip: add sysfs_lock to synchronize sysfs code paths 2021-04-14 08:24:12 +02:00
usbip_event.c usbip: synchronize event handler with sysfs code paths 2021-04-14 08:24:13 +02:00
vhci_hcd.c usb: vhci-hcd: Do not drop references before new references are gained 2024-08-19 05:33:51 +02:00
vhci_rx.c usbip: Fix error path of vhci_recv_ret_submit() 2019-12-31 16:46:05 +01:00
vhci_sysfs.c usbip: add sysfs_lock to synchronize sysfs code paths 2021-04-14 08:24:12 +02:00
vhci_tx.c usbip: Fix free of unallocated memory in vhci tx 2019-10-28 17:51:06 +01:00
vhci.h
vudc_dev.c
vudc_main.c
vudc_rx.c usbip: fix vudc_rx: harden CMD_SUBMIT path to handle malicious input 2018-01-04 17:07:26 +01:00
vudc_sysfs.c usbip: vudc: fix missing unlock on error in usbip_sockfd_store() 2021-05-14 09:44:22 +02:00
vudc_transfer.c
vudc_tx.c
vudc.h