Re: [PATCH] usb: dwc3: Fix GUID register programming order

From: Selvarasu Ganesan

Date: Tue Apr 14 2026 - 08:13:23 EST



On 4/14/2026 6:35 AM, Thinh Nguyen wrote:
> On Fri, Apr 10, 2026, Selvarasu Ganesan wrote:
>> The Linux Version Code is currently written to the GUID register before
>> dwc3_core_soft_reset() is executed. Since the core soft reset clears the
>> GUID register back to its default value, the version information is
>> subsequently lost.
> This is not right. Soft reset should not clear the GUID register.
> Something else must have cleared it. Did you assert Vcc reset (hard
> reset) during phy reset/initialization?
>
> BR,
> Thinh

Hi Thinh,

Thank you for the clarification. Yes, you are correct, this issue is not
related to a dwc3 core soft reset. Instead, the GUID value reverts to
its default state when the PHY link_sw_reset completes during PHY init
sequence.

We are using the Synopsys eUSB PHY, this reset is triggered from our
downstream driver during the PHY init sequence (invoked through
|dwc3_core_init|).

Could you please suggest the best way to retrieve the correct linux
version information from the GUID?
Additionally, would it be feasible to update the GUID register after the
PHY init sequence (triggered by |dwc3_core_init|) completes?

Thanks, Selva

>
>> Move the GUID register programming to occur after the core soft reset
>> has completed to ensure the value persists.
>>
>> Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
>> Cc: stable@xxxxxxxxxxxxxxx
>> Reported-by: Pritam Manohar Sutar <pritam.sutar@xxxxxxxxxxx>
>> Signed-off-by: Selvarasu Ganesan <selvarasu.g@xxxxxxxxxxx>
>> ---
>> drivers/usb/dwc3/core.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index 161a4d58b2cec..0d3c7e7b2262f 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -1341,12 +1341,6 @@ int dwc3_core_init(struct dwc3 *dwc)
>>
>> hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0);
>>
>> - /*
>> - * Write Linux Version Code to our GUID register so it's easy to figure
>> - * out which kernel version a bug was found.
>> - */
>> - dwc3_writel(dwc, DWC3_GUID, LINUX_VERSION_CODE);
>> -
>> ret = dwc3_phy_setup(dwc);
>> if (ret)
>> return ret;
>> @@ -1378,6 +1372,12 @@ int dwc3_core_init(struct dwc3 *dwc)
>> if (ret)
>> goto err_exit_phy;
>>
>> + /*
>> + * Write Linux Version Code to our GUID register so it's easy to figure
>> + * out which kernel version a bug was found.
>> + */
>> + dwc3_writel(dwc, DWC3_GUID, LINUX_VERSION_CODE);
>> +
>> dwc3_core_setup_global_control(dwc);
>> dwc3_core_num_eps(dwc);
>>
>> --
>> 2.34.1