From: sashiko-bot@kernel.org
To: "Alexey Charkov" <alchark@flipper.net>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 1/4] usb: gadget: udc: Clear a pending connection when starting the UDC
Date: Fri, 13 Nov 2026 09:39:42 +0000 [thread overview]
Message-ID: <sashiko-outbox-212560@kernel.org> (raw)
In-Reply-To: <20261113-udc-connect-v2-1-f51b11f07eb8@flipper.net>
> Since commit 62911bc82b03 ("usb: gadget: udc: skip pullup() if already
> connected"), usb_gadget_connect_locked() returns early when
> gadget->connected is set. A connection requested while the UDC is
> stopped sets that flag too, without enabling the pullup. A later
> gadget_bind_driver() or soft_connect "connect" then finds it set and
> never enables the pullup, so the host doesn't see the gadget until it is
> unbound and bound again.
>
> This happens whenever a UDC driver reports VBUS through
> usb_udc_vbus_handler() while no gadget driver is bound, e.g. when a
> Type-C port controller switches the controller to the device role at
> boot, seconds before userspace binds a configfs gadget.
>
> The pullup is never enabled while the UDC is stopped, so clear
> gadget->connected once it starts. The bind connects according to the
> VBUS state that the core tracks anyway, and a function that deactivates
> the gadget during bind still has the connection recorded for
> usb_gadget_activate().
>
> Fixes: 62911bc82b03 ("usb: gadget: udc: skip pullup() if already connected")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexey Charkov <alchark@flipper.net>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-udc-connect-v2-0-f51b11f07eb8@flipper.net?part=1
next prev parent reply other threads:[~2026-11-13 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 9:28 [PATCH v2 0/4] usb: gadget: udc: Rework when the gadget connects Alexey Charkov
2026-11-13 9:28 ` [PATCH v2 1/4] usb: gadget: udc: Clear a pending connection when starting the UDC Alexey Charkov
2026-11-13 9:39 ` sashiko-bot [this message]
2026-11-13 9:28 ` [PATCH v2 2/4] usb: gadget: udc: Forget a deactivation when the gadget driver unbinds Alexey Charkov
2026-11-13 9:36 ` sashiko-bot
2026-11-13 9:28 ` [PATCH v2 3/4] usb: gadget: configfs: Leave resetting the deactivation to the UDC core Alexey Charkov
2026-11-13 9:35 ` sashiko-bot
2026-11-13 9:28 ` [PATCH v2 4/4] usb: gadget: udc: Decide on connecting in one place Alexey Charkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-212560@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alchark@flipper.net \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.