From: sashiko-bot@kernel.org
To: "Elson Serrao" <elson.serrao@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v10 3/7] usb: misc: qcom_eud: add per-path High-Speed PHY control
Date: Mon, 23 Nov 2026 18:48:35 +0000 [thread overview]
Message-ID: <sashiko-outbox-229871@kernel.org> (raw)
In-Reply-To: <20261123182847.143892-4-elson.serrao@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] usb: misc: qcom_eud: eud_probe() fails when secondary path is
disabled in DT
--
commit e2fd91a7c0ed5f3452a494a0a91ef1ddd34b1c26
Author: Elson Serrao <elson.serrao@oss.qualcomm.com>
usb: misc: qcom_eud: add per-path High-Speed PHY control
This commit adds per-path High-Speed PHY management to the Qualcomm EUD
driver so that the PHY associated with the selected UTMI path is
initialized and powered when EUD is enabled.
> diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c
> index fa640e88c88b5..a3afa3bb93481 100644
> --- a/drivers/usb/misc/qcom_eud.c
> +++ b/drivers/usb/misc/qcom_eud.c
[ ... ]
> @@ -228,8 +294,54 @@ static void eud_role_switch_release(void *data)
> usb_role_switch_put(chip->role_sw);
> }
>
> +static int eud_init_path(struct eud_chip *chip, struct device_node *np)
> +{
> + struct device_node *controller_node;
> + struct eud_path *path;
> + u32 path_num;
> + int ret;
> +
> + ret = of_property_read_u32(np, "reg", &path_num);
> + if (ret) {
> + /* Legacy DT uses 'ports' node without 'reg' property; treat as path 0 */
> + if (of_node_name_eq(np, "ports"))
> + path_num = 0;
> + else
> + return dev_err_probe(chip->dev, ret, "unexpected child node '%s'\n",
> + np->name);
> + }
> +
> + if (path_num >= EUD_MAX_PORTS)
> + return dev_err_probe(chip->dev, -EINVAL, "invalid path number: %u (max %d)\n",
> + path_num, EUD_MAX_PORTS - 1);
> +
> + path = devm_kzalloc(chip->dev, sizeof(*path), GFP_KERNEL);
> + if (!path)
> + return -ENOMEM;
> +
> + path->chip = chip;
> + path->num = path_num;
> +
> + controller_node = of_graph_get_remote_node(np, 0, -1);
> + if (!controller_node)
> + return dev_err_probe(chip->dev, -ENODEV,
> + "failed to get controller node for path %u\n", path_num);
> +
> + path->phy = devm_of_phy_get_by_index(chip->dev, controller_node, 0);
> + of_node_put(controller_node);
> +
> + if (IS_ERR(path->phy))
> + return dev_err_probe(chip->dev, PTR_ERR(path->phy),
> + "failed to get PHY for path %d\n", path_num);
> +
> + chip->paths[path_num] = path;
> +
> + return 0;
> +}
> +
> static int eud_probe(struct platform_device *pdev)
> {
> + struct device_node *np = pdev->dev.of_node;
> struct eud_chip *chip;
> struct resource *res;
> int ret;
> @@ -258,7 +370,22 @@ static int eud_probe(struct platform_device *pdev)
> return -ENODEV;
> chip->mode_mgr = res->start;
>
> + for_each_child_of_node_scoped(np, child) {
> + ret = eud_init_path(chip, child);
> + if (ret)
> + return ret;
> + }
> +
> + /* Primary path is mandatory. Secondary is optional */
> + if (!chip->paths[0])
> + return dev_err_probe(chip->dev, -ENODEV, "primary path not found\n");
[Severity: Medium]
Does eud_probe() fail on dual-path SoCs when a board disables the secondary
path or its USB controller/PHY in Devicetree?
for_each_child_of_node_scoped() visits child nodes even when they are
marked status = "disabled" (unlike
for_each_available_child_of_node_scoped()). In Addition, on dual-path SoCs
where the SoC dtsi defines both eud-path@0 and eud-path@1, if a board leaves
the secondary USB controller disabled then of_graph_get_remote_node()
returns NULL (failing probe with -ENODEV), and if the secondary High-Speed
PHY is disabled then devm_of_phy_get_by_index() returns -EPROBE_DEFER
indefinitely, preventing EUD from probing even for the primary port.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123182847.143892-1-elson.serrao@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-11-23 18:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 18:28 [PATCH v10 0/7] Improve Qualcomm EUD driver and platform support Elson Serrao
2026-11-23 18:28 ` [PATCH v10 1/7] dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing Elson Serrao
2026-11-23 18:28 ` [PATCH v10 2/7] usb: misc: qcom_eud: add sysfs attribute for port selection Elson Serrao
2026-11-23 18:28 ` [PATCH v10 3/7] usb: misc: qcom_eud: add per-path High-Speed PHY control Elson Serrao
2026-11-23 18:48 ` sashiko-bot [this message]
2026-11-23 18:28 ` [PATCH v10 4/7] usb: misc: qcom_eud: add per-path role switch support Elson Serrao
2026-11-23 18:56 ` sashiko-bot
2026-11-23 18:28 ` [PATCH v10 5/7] usb: misc: qcom_eud: improve enable_store API Elson Serrao
2026-11-23 18:28 ` [PATCH v10 6/7] usb: misc: qcom_eud: add role-based EUD control Elson Serrao
2026-11-23 18:28 ` [PATCH v10 7/7] usb: misc: qcom_eud: fix virtual attach/detach event handling Elson Serrao
2026-11-23 18:56 ` [PATCH v10 0/7] Improve Qualcomm EUD driver and platform support 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-229871@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=elson.serrao@oss.qualcomm.com \
--cc=linux-usb@vger.kernel.org \
--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