public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization
       [not found] <CGME20260417063502epcas5p4f8f7fefb697e6d130ef7e9a78581ed84@epcas5p4.samsung.com>
@ 2026-04-17  6:33 ` Selvarasu Ganesan
  2026-04-17  7:02   ` Selvarasu Ganesan
  2026-04-17 23:13   ` Thinh Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Selvarasu Ganesan @ 2026-04-17  6:33 UTC (permalink / raw)
  To: Thinh.Nguyen, gregkh, paulz, balbi, linux-usb, linux-kernel
  Cc: jh0801.jung, akash.m5, h10.kim, alim.akhtar, thiagu.r,
	muhammed.ali, Selvarasu Ganesan, stable, Pritam Manohar Sutar

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.

Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
Cc: stable@vger.kernel.org
Reported-by: Pritam Manohar Sutar <pritam.sutar@samsung.com>
Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization
  2026-04-17  6:33 ` [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization Selvarasu Ganesan
@ 2026-04-17  7:02   ` Selvarasu Ganesan
  2026-04-17 23:13   ` Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Selvarasu Ganesan @ 2026-04-17  7:02 UTC (permalink / raw)
  To: Thinh.Nguyen, gregkh, paulz, balbi, linux-usb, linux-kernel
  Cc: jh0801.jung, akash.m5, h10.kim, alim.akhtar, thiagu.r,
	muhammed.ali, stable, Pritam Manohar Sutar


On 4/17/2026 12:03 PM, Selvarasu Ganesan wrote:
> 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.
>
> Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
> Cc: stable@vger.kernel.org
> Reported-by: Pritam Manohar Sutar <pritam.sutar@samsung.com>
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> ---
>   drivers/usb/dwc3/core.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

Apologies, I missed including the what is change in patch-v2 for this 
submission.

Changes in v2:
- Update commit message for properly describe the problem and solution.
Link to v1:  
https://lore.kernel.org/linux-usb/20260410064735.515-1-selvarasu.g@samsung.com/

Thanks,
Selva
> 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);
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization
  2026-04-17  6:33 ` [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization Selvarasu Ganesan
  2026-04-17  7:02   ` Selvarasu Ganesan
@ 2026-04-17 23:13   ` Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2026-04-17 23:13 UTC (permalink / raw)
  To: Selvarasu Ganesan
  Cc: Thinh Nguyen, gregkh@linuxfoundation.org, paulz@synopsys.com,
	balbi@ti.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, jh0801.jung@samsung.com,
	akash.m5@samsung.com, h10.kim@samsung.com,
	alim.akhtar@samsung.com, thiagu.r@samsung.com,
	muhammed.ali@samsung.com, stable@vger.kernel.org,
	Pritam Manohar Sutar

On Fri, Apr 17, 2026, Selvarasu Ganesan wrote:
> 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.
> 
> Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
> Cc: stable@vger.kernel.org
> Reported-by: Pritam Manohar Sutar <pritam.sutar@samsung.com>
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> ---
>  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
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-17 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20260417063502epcas5p4f8f7fefb697e6d130ef7e9a78581ed84@epcas5p4.samsung.com>
2026-04-17  6:33 ` [PATCH v2] usb: dwc3: Move GUID programming after PHY initialization Selvarasu Ganesan
2026-04-17  7:02   ` Selvarasu Ganesan
2026-04-17 23:13   ` Thinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox