android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Elson Roy Serrao 9d8b388a24 usb: dwc3: gadget: Reset num TRBs before giving back the request
commit 00f8205ffcf112dcef14f8151d78075d38d22c08 upstream.

Consider a scenario where cable disconnect happens when there is an active
usb reqest queued to the UDC. As part of the disconnect we would issue an
end transfer with no interrupt-on-completion before giving back this
request. Since we are giving back the request without skipping TRBs the
num_trbs field of dwc3_request still holds the stale value previously used.
Function drivers re-use same request for a given bind-unbind session and
hence their dwc3_request context gets preserved across cable
disconnect/connect. When such a request gets re-queued after cable connect,
we would increase the num_trbs field on top of the previous stale value
thus incorrectly representing the number of TRBs used. Fix this by
resetting num_trbs field before giving back the request.

Fixes: 09fe1f8d7e ("usb: dwc3: gadget: track number of TRBs per request")
Cc: stable <[email protected]>
Signed-off-by: Elson Roy Serrao <[email protected]>
Acked-by: Thinh Nguyen <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-06-21 15:44:10 +02:00
..
atm
c67x00
cdns3 usb: cdns3: Fix issue with using incorrect PCI device function 2023-04-05 11:16:40 +02:00
chipidea usb: chipidea: fix missing goto in ci_hdrc_probe 2023-05-17 11:35:49 +02:00
class USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-30 12:44:06 +01:00
common Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout" 2023-01-18 11:42:06 +01:00
core usb: usbfs: Use consistent mmap functions 2023-06-14 10:59:58 +02:00
dwc2 usb: dwc2: fix wrong order of phy_power_on and phy_init 2022-09-15 12:04:52 +02:00
dwc3 usb: dwc3: gadget: Reset num TRBs before giving back the request 2023-06-21 15:44:10 +02:00
early
gadget usb: gadget: f_fs: Add unbind event before functionfs_unbind 2023-06-09 10:29:00 +02:00
host USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value 2023-05-30 12:44:06 +01:00
image
isp1760
misc USB: sisusbvga: Add endpoint checks 2023-05-30 12:44:10 +01:00
mon usb: mon: make mmapped memory read only 2022-10-15 07:54:38 +02:00
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-17 11:35:49 +02:00
musb treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
phy
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-08-25 11:18:33 +02:00
roles usb: roles: fix of node refcount leak in usb_role_switch_is_parent() 2023-01-18 11:41:24 +01:00
serial USB: serial: option: add Quectel EM061KGL series 2023-06-21 15:44:10 +02:00
storage treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
typec usb: typec: altmodes/displayport: fix pin_assignment_show 2023-05-30 12:44:06 +01:00
usbip usb: usbip: add missing device lock on tweak configuration cmd 2022-06-14 18:11:51 +02:00
Kconfig
Makefile
usb-skeleton.c