usb: dwc3: Fix GUID register programming order
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): CGME20260410070245epcas5p49355581dcb9f629641c9914ce4ce80ec@epcas5p4.samsung.com
PATCH 1/1 usb: dwc3: Fix GUID register programming order
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.
Move the GUID register programming to occur after the core soft reset has completed to ensure the value persists.
--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/usb/dwc3/core.c +6 -6
@@ -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);
Signature · 1 line
2.34.1
Thinh Nguyen
maintainerQuoted 4 lines · Selvarasu Ganesan
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
Quoted 45 lines
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")Reported-by Pritam Manohar Sutar <[email protected]>Signed-off-by Selvarasu Ganesan <[email protected]>--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/usb/dwc3/core.c +6
-6@@ -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);Signature · 1 line
2.34.1
Quoted 11 lines · Thinh Nguyen
Quoted 4 lines · Selvarasu Ganesan
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
Quoted 44 lines
Quoted 44 lines
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")Reported-by Pritam Manohar Sutar <[email protected]>Signed-off-by Selvarasu Ganesan <[email protected]>--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/usb/dwc3/core.c +6
-6@@ -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);Signature · 1 line
2.34.1
Thinh Nguyen
maintainerQuoted 21 lines · Selvarasu Ganesan
Quoted 11 lines · Thinh Nguyen
Quoted 4 lines · Selvarasu Ganesan
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,
ThinhHi 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_resetcompletes during PHY init sequence.
Quoted 9 lines
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?
Yes. Just fix up the changelog to properly describe the problem and solution.
BR,
Thinh
Quoted 29 lines · Thinh Nguyen
Quoted 19 lines · Selvarasu Ganesan
Quoted 11 lines · Thinh Nguyen
Quoted 4 lines · Selvarasu Ganesan
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,
ThinhHi 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_resetcompletes during PHY init sequence.Quoted 9 lines
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?
Quoted 5 lines
Yes. Just fix up the changelog to properly describe the problem and solution.
BR,
Thinh
Hi Thinh,
Thanks for the confirmation. I have modified the changelog as shown below, please review it once then i will post updated patchset.
From: Selvarasu Ganesan <[email protected]>
Date: Thu, 9 Apr 2026 18:34:03 +0530
Subject: [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization
The Linux Version Code is currently written to the GUID register before PHY initialization. Certain PHY implementations (such as Synopsys eUSB PHY performing link_sw_reset) clear the GUID register to its default value during initialization, causing the kernel version information to be lost.
Move the GUID register programming to occur after PHY initialization completes to ensure the Linux version information persists.
GUID register")
--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/usb/dwc3/core.c +0 -2
@@ -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;
@@ -1374,6 +1368,12 @@ int dwc3_core_init(struct dwc3 *dwc)
if (ret)
goto err_exit_ulpi;
+ /*
+ * 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_core_soft_reset(dwc);
if (ret)
goto err_exit_phy;
--
2.34.1
Thanks,
Selva
Thinh Nguyen
maintainerQuoted 89 lines · Selvarasu Ganesan
Quoted 29 lines · Thinh Nguyen
Quoted 19 lines · Selvarasu Ganesan
Quoted 11 lines · Thinh Nguyen
Quoted 4 lines · Selvarasu Ganesan
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,
ThinhHi 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_resetcompletes during PHY init sequence.Quoted 9 lines
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?Quoted 5 lines
Yes. Just fix up the changelog to properly describe the problem and solution.
BR,
ThinhHi Thinh,
Thanks for the confirmation. I have modified the changelog as shown below, please review it once then i will post updated patchset.
From: Selvarasu Ganesan <[email protected]>
Date: Thu, 9 Apr 2026 18:34:03 +0530
Subject: [PATCH v2] usb: dwc3: Move GUID programming after PHY initializationThe Linux Version Code is currently written to the GUID register before PHY initialization. Certain PHY implementations (such as Synopsys eUSB PHY performing
link_sw_reset) clear the GUID register to its default value during initialization, causing the kernel version information to be lost.Move the GUID register programming to occur after PHY initialization completes to ensure the Linux version information persists.
Fixes fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to ourGUID register")
Reported-by Pritam Manohar Sutar <[email protected]>Signed-off-by Selvarasu Ganesan <[email protected]>--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/usb/dwc3/core.c +0
-2@@ -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);drivers/usb/dwc3/core.c +2
-1- ret = dwc3_phy_setup(dwc); if (ret) return ret;@@ -1374,6 +1368,12 @@ int dwc3_core_init(struct dwc3 *dwc) if (ret) goto err_exit_ulpi; + /* +* Write Linux Version Code to our GUID register so it's easy to
Quoted 5 lines
figure
+ * out which kernel version a bug was found. + */
+ dwc3_writel(dwc,DWC3_GUID,LINUX_VERSION_CODE); +
In the really old kernel, the phy init was part of the dwc3_core_soft_reset(). Move this after dwc3_core_soft_reset() just as you had before. It will be better for backporting, and it looks more fitting to place it there.
Quoted 3 lines
ret =
dwc3_core_soft_reset(dwc);
if (ret)
gotoerr_exit_phy;
The changelog looks good.
Thanks,
Thinh
Quoted 87 lines · Thinh Nguyen
Quoted 86 lines · Selvarasu Ganesan
Quoted 29 lines · Thinh Nguyen
Quoted 19 lines · Selvarasu Ganesan
Quoted 11 lines · Thinh Nguyen
Quoted 4 lines · Selvarasu Ganesan
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,
ThinhHi 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_resetcompletes during PHY init sequence.Quoted 9 lines
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?Quoted 5 lines
Yes. Just fix up the changelog to properly describe the problem and solution.
BR,
ThinhHi Thinh,
Thanks for the confirmation. I have modified the changelog as shown below, please review it once then i will post updated patchset.
From: Selvarasu Ganesan <[email protected]>
Date: Thu, 9 Apr 2026 18:34:03 +0530
Subject: [PATCH v2] usb: dwc3: Move GUID programming after PHY initializationThe Linux Version Code is currently written to the GUID register before PHY initialization. Certain PHY implementations (such as Synopsys eUSB PHY performing
link_sw_reset) clear the GUID register to its default value during initialization, causing the kernel version information to be lost.Move the GUID register programming to occur after PHY initialization completes to ensure the Linux version information persists.
Fixes fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to ourGUID register")
Reported-by Pritam Manohar Sutar <[email protected]>Signed-off-by Selvarasu Ganesan <[email protected]>--- drivers/usb/dwc3/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/usb/dwc3/core.c +0
-2@@ -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);drivers/usb/dwc3/core.c +0
-1- ret = dwc3_phy_setup(dwc); if (ret) return ret;@@ -1374,6 +1368,12 @@ int dwc3_core_init(struct dwc3 *dwc) if (ret) goto err_exit_ulpi;
Quoted 11 lines
Quoted 7 lines
drivers/usb/dwc3/core.c +2
-0+ /* +* 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); +In the really old kernel, the phy init was part of the
dwc3_core_soft_reset(). Move this afterdwc3_core_soft_reset()just as you had before. It will be better for backporting, and it looks more fitting to place it there.
Sure.
Quoted 6 lines
Quoted 4 lines
ret = dwc3_core_soft_reset(dwc); if (ret) goto err_exit_phy;The changelog looks good.
Ok. Thanks for the confirmation.
Thanks,
Selva
Quoted 3 lines
Thanks,
Thinh