Re: [PATCH v8 7/8] usb: misc: qcom_eud: fix virtual attach/detach event handling
From: sashiko-bot@kernel.org
Date: 2026-09-12 23:12:53
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 [off-list ref] 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.
quoted hunk ↗ jump to hunk
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