]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: dwc3: gadget: Prevent repeat pullup()
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Fri, 22 Apr 2022 02:22:31 +0000 (19:22 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:11:33 +0000 (15:11 +0100)
commit2e4c7c82e0a1afdfd130c8fc27fa1199878df591
tree5bef70d477ff813ff42fca2dc9dde04d3091454c
parent52af862844ef726499022a0185bc3ee84153bde1
usb: dwc3: gadget: Prevent repeat pullup()

BugLink: https://bugs.launchpad.net/bugs/1995420
[ Upstream commit 69e131d1ac4e52a59ec181ab4f8aa8c48cd8fb64 ]

Don't do soft-disconnect if it's previously done. Likewise, don't do
soft-connect if the device is currently connected and running. It would
break normal operation.

Currently the caller of pullup() (udc's sysfs soft_connect) only checks
if it had initiated disconnect to prevent repeating soft-disconnect. It
doesn't check for soft-connect. To be safe, let's keep the check here
regardless whether the udc core is fixed.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/1c1345bd66c97a9d32f77d63aaadd04b7b037143.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 040f2dbd2010 ("usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/dwc3/gadget.c