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 v3 01/10] usb: dwc3: core: Allow glue layer to pass reference clock rate
Date: Sun, 06 Sep 2026 04:55:40 +0000 [thread overview]
Message-ID: <20260906045540.7F42F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260906-ipq-flatten-usb-v3-1-13e4e0f63123@outlook.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect precedence in `dwc3_ref_clk_period` causes the deprecated `snps,ref-clock-period-ns` DT property to override the accurate hardware clock rate.
--
commit bfd0f3ac4b25de50cc391001782d48a93da996fb
Author: George Moussalem <george.moussalem@outlook.com>
usb: dwc3: core: Allow glue layer to pass reference clock rate
This commit allows the glue layer to pass the reference clock rate directly
to the DWC3 core driver. This enables hardware using the flattened snsp-dwc3
model to accurately calculate the period and frame length adjustment without
relying on the default reference clock.
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index fd5c2cd36c595..6ff0e4822b493 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -420,6 +420,9 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc)
> } else if (dwc->ref_clk_per) {
> period = dwc->ref_clk_per;
> rate = NSEC_PER_SEC / period;
> + } else if (dwc->ref_clk_rate) {
> + rate = dwc->ref_clk_rate;
> + period = NSEC_PER_SEC / rate;
> } else {
> return;
> }
[Severity: Medium]
Will this evaluation order cause issues for systems booting with a legacy
device tree?
If an older device tree defines the deprecated snps,ref-clock-period-ns
property, dwc->ref_clk_per is populated. In the flattened model, the glue
driver sets ignore_clocks_and_resets = true, which leaves dwc->ref_clk as
NULL.
Because dwc->ref_clk is NULL, the execution will fall into the
else if (dwc->ref_clk_per) block. This uses the deprecated and inaccurate
period-derived rate, completely bypassing the exact hardware clock rate now
provided via dwc->ref_clk_rate.
Should dwc->ref_clk_rate take precedence over the deprecated and less
accurate dwc->ref_clk_per?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260906-ipq-flatten-usb-v3-0-13e4e0f63123@outlook.com?part=1
next prev parent reply other threads:[~2026-09-06 4:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 4:46 [PATCH v3 00/10] Flatten USB Controller Nodes on IPQ SoCs George Moussalem via B4 Relay
2026-09-06 4:46 ` [PATCH v3 01/10] usb: dwc3: core: Allow glue layer to pass reference clock rate George Moussalem via B4 Relay
2026-09-06 4:55 ` sashiko-bot [this message]
2026-09-07 5:05 ` Varadarajan Narayanan
2026-09-06 4:46 ` [PATCH v3 02/10] usb: dwc3: qcom: Add support for selecting UTMI as reference clock George Moussalem via B4 Relay
2026-09-07 4:06 ` Varadarajan Narayanan
2026-09-06 4:46 ` [PATCH v3 03/10] arm64: dts: qcom: ipq5018: Flatten usb controller node George Moussalem via B4 Relay
2026-09-06 4:46 ` [PATCH v3 04/10] arm64: dts: qcom: ipq5332: " George Moussalem via B4 Relay
2026-09-06 4:46 ` [PATCH v3 05/10] arm64: dts: qcom: ipq5424: Flatten usb controller nodes George Moussalem via B4 Relay
2026-09-06 4:58 ` sashiko-bot
2026-09-07 12:58 ` Konrad Dybcio
2026-09-06 4:46 ` [PATCH v3 06/10] arm64: dts: qcom: ipq6018: move DR mode to board DTS George Moussalem via B4 Relay
2026-09-07 12:57 ` Konrad Dybcio
2026-09-06 4:46 ` [PATCH v3 07/10] arm64: dts: qcom: ipq6018: Flatten usb controller nodes George Moussalem via B4 Relay
2026-09-07 12:58 ` Konrad Dybcio
2026-09-06 4:46 ` [PATCH v3 08/10] arm64: dts: qcom: ipq8074: move DR mode to board DTS George Moussalem via B4 Relay
2026-09-07 12:57 ` Konrad Dybcio
2026-09-06 4:46 ` [PATCH v3 09/10] arm64: dts: qcom: ipq8074: Flatten usb controller nodes George Moussalem via B4 Relay
2026-09-07 13:00 ` Konrad Dybcio
2026-09-06 4:46 ` [PATCH v3 10/10] arm64: dts: qcom: ipq9574: Flatten usb controller node George Moussalem via B4 Relay
2026-09-07 13:34 ` Abel Vesa
2026-09-09 9:09 ` Konrad Dybcio
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=20260906045540.7F42F1F00A3A@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox