From: sashiko-bot@kernel.org
To: "Qianhui Xu" <xiaqinghuan@mail.ustc.edu.cn>, linux-usb@vger.kernel.org
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v10 3/3] usb: dwc3: select the shared HS data bus with a mux controller
Date: Sat, 21 Nov 2026 02:33:15 +0000 [thread overview]
Message-ID: <sashiko-outbox-226546@kernel.org> (raw)
In-Reply-To: <20261121022104.1507987-4-xiaqinghuan@mail.ustc.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] usb: dwc3: premature mux deselection before role teardown in
dwc3_drd_exit()
--
commit c2bf2129dd204f48fafe772bcfa69b9f05541e6c
Author: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>
usb: dwc3: select the shared HS data bus with a mux controller
This commit adds support for switching a shared High Speed D+/D- data bus
between two connectors using a mux controller and per-connector USB role
switches.
> diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
> index f3e37d383627a..f14686dee095e 100644
> --- a/drivers/usb/dwc3/drd.c
> +++ b/drivers/usb/dwc3/drd.c
[ ... ]
> @@ -597,6 +914,7 @@ void dwc3_drd_exit(struct dwc3 *dwc)
> {
> unsigned long flags;
>
> + dwc3_role_mux_exit(dwc);
> if (dwc->role_sw)
> usb_role_switch_unregister(dwc->role_sw);
>
> @@ -606,6 +924,9 @@ void dwc3_drd_exit(struct dwc3 *dwc)
>
> cancel_work_sync(&dwc->drd_work);
>
> + /* The mode worker is drained: no switch can select the mux any more. */
> + dwc3_role_mux_deselect(dwc);
> +
> /* debug user might have changed role, clean based on current role */
> switch (dwc->current_dr_role) {
> case DWC3_GCTL_PRTCAP_HOST:
[Severity: Medium]
Should dwc3_role_mux_deselect() be called after the
switch (dwc->current_dr_role) block tears down the active host or gadget
instance?
When the mux controller has an idle state other than MUX_IDLE_AS_IS and
the active connector is not the idle port, mux_control_deselect() switches
the High Speed data lines back to the idle state while the host or gadget
instance is still running. In __dwc3_set_mode(), dwc3_host_exit() or
dwc3_gadget_exit() runs before mux_control_deselect() so the active role
is torn down while its own data lines are still selected.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261121022104.1507987-1-xiaqinghuan@mail.ustc.edu.cn?part=3
next prev parent reply other threads:[~2026-11-21 2:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 5:21 [PATCH v9 0/3] usb: dwc3: support two connectors sharing one HS data bus Qianhui Xu
2026-11-17 5:21 ` [PATCH v9 1/3] dt-bindings: usb: snps,dwc3: two connectors are two endpoints of one port Qianhui Xu
2026-11-17 5:40 ` sashiko-bot
2026-11-18 15:34 ` Rob Herring
2026-11-17 5:21 ` [PATCH v9 2/3] usb: roles: look up role switches attached to a graph endpoint Qianhui Xu
2026-11-17 5:27 ` sashiko-bot
2026-11-17 5:21 ` [PATCH v9 3/3] usb: dwc3: select the shared HS data bus with a mux controller Qianhui Xu
2026-11-17 5:37 ` sashiko-bot
2026-11-18 15:27 ` Rob Herring
2026-11-21 2:21 ` [PATCH v10 0/3] usb: dwc3: support two connectors sharing one HS data bus Qianhui Xu
2026-11-21 2:21 ` [PATCH v10 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on " Qianhui Xu
2026-11-21 2:40 ` sashiko-bot
2026-11-21 2:21 ` [PATCH v10 2/3] usb: roles: look up role switches attached to a graph endpoint Qianhui Xu
2026-11-21 2:21 ` [PATCH v10 3/3] usb: dwc3: select the shared HS data bus with a mux controller Qianhui Xu
2026-11-21 2:33 ` sashiko-bot [this message]
2026-11-21 2:40 ` [PATCH v10 0/3] usb: dwc3: support two connectors sharing one HS data bus sashiko-bot
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-226546@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xiaqinghuan@mail.ustc.edu.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox