From: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
To: George Moussalem <george.moussalem@outlook.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Subject: Re: [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as reference clock
Date: Wed, 26 Aug 2026 15:57:36 +0530 [thread overview]
Message-ID: <1100f494-4543-4393-b914-707927a968ca@oss.qualcomm.com> (raw)
In-Reply-To: <SN7PR19MB6736ED851811D9C91DE7BD529DAE2@SN7PR19MB6736.namprd19.prod.outlook.com>
On 8/26/2026 3:07 PM, George Moussalem wrote:
> On 8/26/26 13:18, Konrad Dybcio wrote:
>> On 8/25/26 12:42 PM, George Moussalem via B4 Relay wrote:
>>> From: George Moussalem <george.moussalem@outlook.com>
>>>
>>> On many Qualcomm chipsets, the UTMI clock is used as the reference clock
>>> (ex. IPQ5018, IPQ6018, and IPQ9574 and more). Since moving to the new
>>> flattened snps-dwc3 model, it is no longer possible to pass the
>>> reference clock to the dwc3 core driver.
>>>
>>> The clock rate is used by dwc3 core to derive the reference clock period
>>> and frame length adjusment. This is needed when the reference clock
>>> deviates from the hardware default (typically 19.2MHz). Above mentioned
>>> SoCs use different rates and, as such, the core initializes with the
>>> wrong values which leads to non-functional USB operation.
>>>
>>> Read the "qcom,select-utmi-as-ref-clk" property to determine if the UTMI
>>> clock should be used as the reference clock. If so, set it as the
>>> reference clock in the dwc3_probe_data structure.
>>> The dwc3 core driver will then use this clock to derive the clock rate.
>>>
>>> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
>>> ---
>>
>> There's a shorter patch in flight:
>>
>> https://lore.kernel.org/linux-arm-msm/20260825-ctrl-v1-2-609e2291814d@oss.qualcomm.com/
>
> I'm aware and have discussed that with Varada. My concerns are that
> directly setting qcom->dwc->ref_clk from the glue layer is a layering
> violation. This patch passes it to the DWC3 core via the probe_data struct.
>
> In addition, if ignore_clocks_and_resets is set in the glue layer (which
> is the case for qcom's and others), setting the dwc->ref_clk makes it
> become managed by the core which is the opposite of what the
> ignore_clocks_and_resets property is there for.
>
I believe doing it from here is better. In [1], refclk is being added as
a new clock, but I checked with Varada offline and he said that he
wanted to pass mock_utmi as ref_clk. IMO This patch is better as it
reuses mock_utmi instead of adding another new clock.
[1]:
https://lore.kernel.org/all/20260825-ctrl-v1-2-609e2291814d@oss.qualcomm.com/
Regards,
Krishna,
next prev parent reply other threads:[~2026-08-26 10:27 UTC|newest]
Thread overview: 16+ 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 ` [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:52 ` sashiko-bot
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 ` [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as " George Moussalem via B4 Relay
2026-08-25 10:59 ` sashiko-bot
2026-08-26 9:18 ` Konrad Dybcio
2026-08-26 9:37 ` George Moussalem
2026-08-26 10:27 ` Krishna Kurapati [this message]
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 ` [PATCH 5/9] arm64: dts: qcom: ipq5332: " George Moussalem via B4 Relay
2026-08-25 10:42 ` [PATCH 6/9] arm64: dts: qcom: ipq5424: Flatten usb controller nodes George Moussalem via B4 Relay
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 ` [PATCH 8/9] arm64: dts: qcom: ipq8074: " George Moussalem via B4 Relay
2026-08-25 10:42 ` [PATCH 9/9] arm64: dts: qcom: ipq9574: Flatten usb controller node George Moussalem via B4 Relay
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=1100f494-4543-4393-b914-707927a968ca@oss.qualcomm.com \
--to=krishna.kurapati@oss.qualcomm.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=george.moussalem@outlook.com \
--cc=gregkh@linuxfoundation.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_wcheng@quicinc.com \
--cc=robh@kernel.org \
--cc=varadarajan.narayanan@oss.qualcomm.com \
/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