Re: [PATCH v2 1/3] usb: dwc2: gadget: honor pullup requests in core_connect
From: Thinh Nguyen
Date: Fri Dec 04 2026 - 14:18:03 EST
On Wed, Nov 11, 2026, Inochi Amaoto wrote:
> The connector ID work initializes the peripheral controller and calls
> dwc2_hsotg_core_connect() even when no gadget driver has requested a
> connection. After a host-to-device role change, this clears SFTDISCON
> and lets the host enumerate an unconfigured gadget.
>
> Check enabled in the connection helper. So the device will keep
> disconnect until the controller is ready
>
> Fixes: 510ffaa48eac ("usb: dwc2: Initialize the USB core for peripheral mode")
Can we Cc stable?
> Signed-off-by: Inochi Amaoto <inochiama@xxxxxxxxx>
> ---
> drivers/usb/dwc2/gadget.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 6c8a9f05fff0..5c8e85493289 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3664,7 +3664,8 @@ void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg)
> void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg)
> {
> /* remove the soft-disconnect and let's go */
> - if (!hsotg->role_sw || (dwc2_readl(hsotg, GOTGCTL) & GOTGCTL_BSESVLD))
> + if (hsotg->enabled &&
> + (!hsotg->role_sw || (dwc2_readl(hsotg, GOTGCTL) & GOTGCTL_BSESVLD)))
> dwc2_clear_bit(hsotg, DCTL, DCTL_SFTDISCON);
> }
>
> --
> 2.56.0
>
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
Thanks,
Thinh