]> git.itanic.dy.fi Git - linux-stable/commit
usb: dwc3: gadget: Prevent repeat pullup()
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Fri, 22 Apr 2022 02:22:31 +0000 (19:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 May 2022 20:03:22 +0000 (22:03 +0200)
commit69e131d1ac4e52a59ec181ab4f8aa8c48cd8fb64
treebf34bf4fcce2787e86621c8f6cdc49d7a254b6fe
parentca05b38252d7bf6b0d42e80b3d3d98a642f4143b
usb: dwc3: gadget: Prevent repeat pullup()

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>
drivers/usb/dwc3/gadget.c