From: sashiko-bot@kernel.org
To: "Elson Serrao" <elson.serrao@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 8/9] arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node
Date: Mon, 03 Aug 2026 03:54:01 +0000 [thread overview]
Message-ID: <20260803035401.F3FCA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803031534.2942628-9-elson.serrao@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The patch creates a broken (asymmetric) OF graph connection by modifying `kodiak.dtsi` without updating dependent board files, which breaks USB role switching for EUD.
- [Medium] Missing mutex lock in `port_store` allows a race condition with `enable_store` and role switch callbacks, potentially corrupting EUD hardware state.
--
--- Patch [8]: [PATCH v5 8/9] arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node ---
commit 6a20db16eb123d18691f3748fc7fc0dc057b3d4c
Author: Elson Serrao <elson.serrao@oss.qualcomm.com>
arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node
This patch updates the EUD description to explicitly model the topology
using a child node and adds a role-switch declaration. It removes the
USB endpoint mapping to the secondary controller, associating it with
the primary controller, and enables the EUD by default.
> diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> index fa540d8c2615d..be9d02760a985 100644
> --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
[ ... ]
> @@ -4736,16 +4730,28 @@ eud: eud@88e0000 {
[ ... ]
> + eud0: eud-path@0 {
> + reg = <0>;
> + usb-role-switch;
>
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + eud_usb: endpoint {
> + remote-endpoint = <&usb_1_dwc3_hs>;
> + };
> + };
[Severity: High]
Does this create an asymmetric OF graph connection?
If downstream board files (like qcs6490-rb3gen2.dts) override usb_1_dwc3_hs
to point directly to their Type-C connectors (e.g., pmic_glink_hs_in),
wouldn't this leave eud_usb as a dangling one-way link?
This would violate the OF graph specification which strictly requires
symmetric bidirectional links.
[ ... ]
> @@ -4972,6 +4978,7 @@ port@0 {
> reg = <0>;
>
> usb_1_dwc3_hs: endpoint {
> + remote-endpoint = <&eud_usb>;
> };
> };
[Severity: High]
Will Type-C role switch events bypass the EUD driver entirely on boards
that override this endpoint?
If the OF graph connection is broken by downstream overrides, could this
leave the enabled EUD hardware permanently waiting for role change callbacks
that never arrive?
Additionally, looking at drivers/usb/misc/qcom_eud.c:port_store():
/* Port selection must be done before enabling EUD */
if (chip->enabled)
return -EBUSY;
writel(port, chip->base + EUD_REG_PORT_SEL);
chip->port_idx = port;
[Severity: Medium]
Does this missing mutex lock in port_store() allow a race condition with
enable_store()?
If a concurrent sysfs write to enable and port occurs, port_store() can
interleave with enable_store() since it doesn't hold chip->state_lock.
Could this allow enable_store() to perform role checks using one port but
configure and enable the PHY for another port, misaligning the internal
driver state with the hardware?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803031534.2942628-1-elson.serrao@oss.qualcomm.com?part=8
next prev parent reply other threads:[~2026-08-03 3:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 3:15 [PATCH v5 0/9] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-08-03 3:15 ` [PATCH v5 1/9] dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing Elson Serrao
2026-08-03 3:23 ` sashiko-bot
2026-08-03 3:15 ` [PATCH v5 2/9] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
2026-08-03 3:25 ` sashiko-bot
2026-08-03 3:15 ` [PATCH v5 3/9] usb: misc: qcom_eud: add per-path High-Speed PHY control Elson Serrao
2026-08-03 3:28 ` sashiko-bot
2026-08-03 3:15 ` [PATCH v5 4/9] usb: misc: qcom_eud: add per-path role switch support Elson Serrao
2026-08-03 3:30 ` sashiko-bot
2026-08-03 9:37 ` Peter Chen
2026-08-03 3:15 ` [PATCH v5 5/9] usb: misc: qcom_eud: improve enable_store API Elson Serrao
2026-08-03 3:25 ` sashiko-bot
2026-08-03 3:15 ` [PATCH v5 6/9] usb: misc: qcom_eud: add role-based EUD control Elson Serrao
2026-08-03 3:27 ` sashiko-bot
2026-08-03 9:50 ` Peter Chen
2026-08-03 3:15 ` [PATCH v5 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
2026-08-03 3:26 ` sashiko-bot
2026-08-03 3:15 ` [PATCH v5 8/9] arm64: dts: qcom: kodiak: Describe EUD UTMI path using child node Elson Serrao
2026-08-03 3:54 ` sashiko-bot [this message]
2026-08-03 3:15 ` [PATCH v5 9/9] arm64: dts: qcom: Map USB connector to EUD on Kodiak boards Elson Serrao
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=20260803035401.F3FCA1F000E9@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