Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Elson Serrao" <elson.serrao@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 7/8] usb: misc: qcom_eud: fix virtual attach/detach event handling
Date: Sat, 12 Sep 2026 23:12:52 +0000	[thread overview]
Message-ID: <20260912231253.163761F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260912225301.3396556-8-elson.serrao@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Medium] Disabling EUD while virtually detached leaves the USB controller stuck in a disconnected state.
--

commit 29002e5f224d237570095828a981e93ede8860c1
Author: Elson Serrao <elson.serrao@oss.qualcomm.com>

usb: misc: qcom_eud: fix virtual attach/detach event handling

EUD provides virtual USB attach/detach events to simulate cable plug/unplug
while maintaining the physical debug connection. This commit fixes virtual
detach handling by setting the USB role to NONE instead of HOST.

> diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
> index 1ed81e0c7dc8e..423320cdc704a 100644
> --- a/drivers/usb/misc/qcom_eud.c
> +++ b/drivers/usb/misc/qcom_eud.c
> @@ -313,10 +313,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, void *data)
>  	if (!chip->enabled || path->curr_role != USB_ROLE_DEVICE)
>  		goto out;
>  
> [ ... ]
>  	if (chip->usb_attached)
>  		ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_DEVICE);
>  	else
> -		ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_HOST);
> +		ret = usb_role_switch_set_role(path->controller_sw, USB_ROLE_NONE);

[Severity: Medium]
This is a pre-existing issue, but does disabling EUD while virtually detached
leave the USB controller stuck in a disconnected state?

If EUD is enabled via sysfs, a physical connection is made, EUD triggers a
virtual detach (setting the controller role to NONE), and a user disables
EUD via the enable sysfs node.

The driver disables EUD, but no role restoration is performed for
path->controller_sw to reflect the physical path->curr_role:

drivers/usb/misc/qcom_eud.c:enable_store() {
    ...
	} else {
		ret = disable_eud(chip);
		if (ret) {
			dev_err(chip->dev, "failed to disable eud\n");
			return ret;
		}
	}
    ...
}

Does the controller remain functionally disconnected (USB_ROLE_NONE) despite
being physically connected (USB_ROLE_DEVICE) until a physical unplug and
replug occurs?

>  	if (ret)
>  		dev_err(chip->dev, "failed to set role switch\n");

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260912225301.3396556-1-elson.serrao@oss.qualcomm.com?part=7

  reply	other threads:[~2026-09-12 23:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12 22:52 [PATCH v8 0/8] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-09-12 22:52 ` [PATCH v8 1/8] dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing Elson Serrao
2026-09-12 22:52 ` [PATCH v8 2/8] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
2026-09-12 23:02   ` sashiko-bot
2026-09-12 22:52 ` [PATCH v8 3/8] usb: misc: qcom_eud: add per-path High-Speed PHY control Elson Serrao
2026-09-12 23:16   ` sashiko-bot
2026-09-12 22:52 ` [PATCH v8 4/8] usb: misc: qcom_eud: add per-path role switch support Elson Serrao
2026-09-12 23:08   ` sashiko-bot
2026-09-12 22:52 ` [PATCH v8 5/8] usb: misc: qcom_eud: improve enable_store API Elson Serrao
2026-09-12 22:52 ` [PATCH v8 6/8] usb: misc: qcom_eud: add role-based EUD control Elson Serrao
2026-09-12 23:03   ` sashiko-bot
2026-09-12 22:53 ` [PATCH v8 7/8] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
2026-09-12 23:12   ` sashiko-bot [this message]
2026-09-12 22:53 ` [PATCH v8 8/8] arm64: dts: qcom: kodiak: Desribe EUD UTMI routing and connector mapping Elson Serrao
2026-09-12 23:11   ` 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=20260912231253.163761F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elson.serrao@oss.qualcomm.com \
    --cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox