From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 375DE29BDBB for ; Fri, 10 Apr 2026 07:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775804574; cv=none; b=lgX9beb4DsmxawZ9CWmLHRpvqRBv+J/EOa3nWC4rE9sdeDmua/4vLJQhQ2swN0YdKqSI4C7JP+xsISSu12O/1B5ru436MZlR2sgYT5wNoF0VAjHU0k0Y1SzFg8izmpkXLyV1rKj7G8i6v1QFzErnjIYAzWYG0zirgLUecEtOpIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775804574; c=relaxed/simple; bh=K3hQ5jm8t2fkVfIGCGJVlfspJl1D3BTnooCoyYx0Wvc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: References; b=ZCmEkAwQPiSjsPNkQ7S9dbES9DteNsKnA8xFQaK9+V8VNjHI5Johqa2MA57G/USt0Hc/beXRU3gR0RkqEka7BLPDcXoEEe1ahOOuNvnqjAsDykxWrEHkuI621zNK+Wwm+ODNBSYySeU3dQU+0RaU5O8Rfh2ecWWoJPHjmkrkZoQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=l+Yx/GS4; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="l+Yx/GS4" Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20260410070248epoutp03e24ff75c7ecf13f7ac897f3f29c883e7~k7NixTHvG0128301283epoutp03Y for ; Fri, 10 Apr 2026 07:02:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20260410070248epoutp03e24ff75c7ecf13f7ac897f3f29c883e7~k7NixTHvG0128301283epoutp03Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1775804568; bh=Ly11Qb8xbXT7ta5nbljznCsqDDGBC9Gx+vpX8sP8kH4=; h=From:To:Cc:Subject:Date:References:From; b=l+Yx/GS4mMC2KOyLe2mRIlEDvEHBhGbzC2VvjBLB3WF4PtNC+6h7kssmpUifPNRSz bpnVxixXadFQLcxJ7dVRjheol6fd3MSGKlVtT7KgnKmE2gEqPVQ1yyFtM5g9rcQzA4 gJo0bchFUTrwft+vjZy/8FtrTDdd4FhuKIGbSwuM= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20260410070246epcas5p42824d616f378776a04d39990334c5103~k7NhBXniQ0059900599epcas5p4Q; Fri, 10 Apr 2026 07:02:46 +0000 (GMT) Received: from epcas5p4.samsung.com (unknown [182.195.38.89]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4fsSRn6nl5z6B9mR; Fri, 10 Apr 2026 07:02:45 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20260410070245epcas5p49355581dcb9f629641c9914ce4ce80ec~k7Nf5nw3I0059900599epcas5p4M; Fri, 10 Apr 2026 07:02:45 +0000 (GMT) Received: from INBRO002811.samsungds.net (unknown [107.122.5.126]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20260410070243epsmtip1db18ff3b1c3a232910599fcdb8087852~k7Ndsb-eF3258032580epsmtip14; Fri, 10 Apr 2026 07:02:42 +0000 (GMT) From: Selvarasu Ganesan To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org, paulz@synopsys.com, balbi@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jh0801.jung@samsung.com, akash.m5@samsung.com, h10.kim@samsung.com, alim.akhtar@samsung.com, thiagu.r@samsung.com, muhammed.ali@samsung.com, Selvarasu Ganesan , stable@vger.kernel.org, Pritam Manohar Sutar Subject: [PATCH] usb: dwc3: Fix GUID register programming order Date: Fri, 10 Apr 2026 12:17:32 +0530 Message-ID: <20260410064735.515-1-selvarasu.g@samsung.com> X-Mailer: git-send-email 2.46.0.windows.1 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMS-MailID: 20260410070245epcas5p49355581dcb9f629641c9914ce4ce80ec X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20260410070245epcas5p49355581dcb9f629641c9914ce4ce80ec References: 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. Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register") Cc: stable@vger.kernel.org Reported-by: Pritam Manohar Sutar Signed-off-by: Selvarasu Ganesan --- 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