Re: [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as reference clock
From: Krishna Kurapati
Date: Wed Aug 26 2026 - 06:33:48 EST
On 8/26/2026 3:07 PM, George Moussalem wrote:
On 8/26/26 13:18, Konrad Dybcio wrote: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.
On 8/25/26 12:42 PM, George Moussalem via B4 Relay wrote:
From: George Moussalem <george.moussalem@xxxxxxxxxxx>
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@xxxxxxxxxxx>
---
There's a shorter patch in flight:
https://lore.kernel.org/linux-arm-msm/20260825-ctrl-v1-2-609e2291814d@xxxxxxxxxxxxxxxx/
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.
[1]: https://lore.kernel.org/all/20260825-ctrl-v1-2-609e2291814d@xxxxxxxxxxxxxxxx/
Regards,
Krishna,