Commit 6b2820b4 authored by Roy Luo's avatar Roy Luo Committed by Android Build Cherrypicker Worker
Browse files

FROMGIT: usb: dwc3: gadget: Fix incorrect UDC state after manual deconfiguration



The UDC state in sysfs (/sys/class/udc/<udc>/state) should accurately
reflect the current state of the USB Device Controller.

Currently, the UDC state is not handled consistently during gadget
disconnection. While the disconnect interrupt path correctly sets the
state to "not-attached", manual deconfiguration leaves the state in
"configured", misrepresenting the actual situation.

This commit ensures consistent UDC state handling by setting the state to
"not-attached" after manual deconfiguration. This accurately reflects the
UDC's state and provides a consistent behavior regardless of the
disconnection method.

Signed-off-by: default avatarRoy Luo <royluo@google.com>
Reviewed-by: default avatarAndré Draszik <andre.draszik@linaro.org>
Tested-by: default avatarAndré Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20241223042536.1465299-1-royluo@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 339241080
(cherry picked from commit 1ff24d40
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git


 usb-next)
Signed-off-by: default avatarRoy Luo <royluo@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:3f924195e2221970e40c33cdca57933f4b63bf31)
Merged-In: I6840073addbcbd2acd0145363e4e5aac2f7422ee
Change-Id: I6840073addbcbd2acd0145363e4e5aac2f7422ee
parent 91f6ca84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment