All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "George Moussalem" <george.moussalem@outlook.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as reference clock
Date: Tue, 25 Aug 2026 10:59:48 +0000	[thread overview]
Message-ID: <20260825105948.9D2301F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825-ipq-flatten-usb-v1-3-5c1f3170bbe9@outlook.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The error code from `devm_clk_get_optional` is overwritten and ignored, failing to abort the probe on errors like `-EPROBE_DEFER`.
- [Medium] Use of `devm_clk_get_optional` instead of `devm_clk_get` for a conditionally required clock.
--

--- Patch [3]: [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as reference clock ---
commit 62ea0cca7668740a78a41a22a25751f5e998df7d
Author: George Moussalem <george.moussalem@outlook.com>

usb: dwc3: qcom: Add support for selecting UTMI as reference clock

This commit adds support for selecting the UTMI clock as the reference clock
for the DWC3 core on certain Qualcomm chipsets. It reads a device tree
property to determine if the UTMI clock should be used and passes it to the
core driver via the probe data.

> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c

[ ... ]

> @@ -698,6 +700,18 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>  			qcom->current_role = USB_ROLE_DEVICE;
>  	}
>  
> +	select_utmi_as_ref_clk = device_property_read_bool(dev,
> +					"qcom,select-utmi-as-ref-clk");
> +	if (select_utmi_as_ref_clk) {

[Severity: Medium]
Since the UTMI clock is required to derive the reference clock period when
"qcom,select-utmi-as-ref-clk" is set, should this use devm_clk_get() instead?

If the "mock_utmi" clock is missing from the Device Tree,
devm_clk_get_optional() will return NULL rather than an error pointer.
Because IS_ERR(NULL) is false, the driver will silently continue with a NULL
clock, which might lead to the same non-functional USB operation mentioned in
the commit message.

> +		ref_clk = devm_clk_get_optional(dev, "mock_utmi");
> +		if (IS_ERR(ref_clk)) {
> +			ret = PTR_ERR(ref_clk);

[Severity: High]
Does this missing error handling silently swallow probe deferrals?

If devm_clk_get_optional() returns an error like -EPROBE_DEFER, the error
code is stored in 'ret' and a warning is logged, but execution continues.
The 'ret' variable will then be overwritten by the return value of
dwc3_core_probe() shortly after:

dwc3_qcom_probe() {
    ...
    ret = dwc3_core_probe(&probe_data);
    if (ret) {
        ret = dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
        goto clk_disable;
    }
    ...
}

Should this error path abort the probe with a goto clk_disable?

> +			dev_warn(dev, "failed to get ref clock: %d\n", ret);
> +		} else {
> +			probe_data.ref_clk = ref_clk;
> +		}
> +	}
> +
>  	qcom->dwc.glue_ops = &dwc3_qcom_glue_ops;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825-ipq-flatten-usb-v1-0-5c1f3170bbe9@outlook.com?part=3

  reply	other threads:[~2026-08-25 10:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 10:42 [PATCH 0/9] Flatten USB Controller Nodes on IPQ SoCs George Moussalem via B4 Relay
2026-08-25 10:42 ` George Moussalem
2026-08-25 10:42 ` [PATCH 1/9] dt-bindings: usb: qcom,snps-dwc3: Add ability to select UTMI as reference clock George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-25 10:52   ` sashiko-bot
2026-08-30  9:41   ` Krzysztof Kozlowski
2026-08-30 13:17     ` George Moussalem
2026-08-31 12:26       ` Krzysztof Kozlowski
2026-08-25 10:42 ` [PATCH 2/9] usb: dwc3: core: Allow glue layer to pass " George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-30  9:42   ` Krzysztof Kozlowski
2026-09-03  4:57     ` George Moussalem
2026-08-25 10:42 ` [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as " George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-25 10:59   ` sashiko-bot [this message]
2026-08-26  9:18   ` Konrad Dybcio
2026-08-26  9:37     ` George Moussalem
2026-08-26 10:27       ` Krishna Kurapati
2026-08-27 11:42   ` Varadarajan Narayanan
2026-08-27 11:49     ` George Moussalem
2026-08-25 10:42 ` [PATCH 4/9] arm64: dts: qcom: ipq5018: Flatten usb controller node George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-25 10:42 ` [PATCH 5/9] arm64: dts: qcom: ipq5332: " George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-25 10:42 ` [PATCH 6/9] arm64: dts: qcom: ipq5424: Flatten usb controller nodes George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-25 11:08   ` sashiko-bot
2026-08-25 10:42 ` [PATCH 7/9] arm64: dts: qcom: ipq6018: " George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-29 16:48   ` Krishna Kurapati
2026-08-30  3:12     ` George Moussalem
2026-09-01 15:24       ` Konrad Dybcio
2026-08-25 10:42 ` [PATCH 8/9] arm64: dts: qcom: ipq8074: " George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-29 16:41   ` Krishna Kurapati
2026-08-30  3:14     ` George Moussalem
2026-08-25 10:42 ` [PATCH 9/9] arm64: dts: qcom: ipq9574: Flatten usb controller node George Moussalem via B4 Relay
2026-08-25 10:42   ` George Moussalem
2026-08-29 16:44   ` Krishna Kurapati
2026-08-30  3:15     ` George Moussalem

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=20260825105948.9D2301F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=george.moussalem@outlook.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.