Commit aad35f9c authored by Selvarasu Ganesan's avatar Selvarasu Ganesan Committed by Greg Kroah-Hartman
Browse files

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.

Fixes: fa0ea13e ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
Cc: stable <stable@kernel.org>
Reported-by: default avatarPritam Manohar Sutar <pritam.sutar@samsung.com>
Signed-off-by: default avatarSelvarasu Ganesan <selvarasu.g@samsung.com>
Acked-by: default avatarThinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260417063314.2359-1-selvarasu.g@samsung.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6ec9bb4
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1359,12 +1359,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;
@@ -1398,6 +1392,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);