From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7EADB224B15 for ; Wed, 13 May 2026 13:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778680417; cv=none; b=VqRroEyzagg20fFQ9zvl8GYrWlmud7Cy5GD1MC39Jp+TcF/Eud4miYusfZUlSpF526xGH8qaAgYcbdTJ/TEfWAZAKUhCSTDgsDU1CcIQd/IV8dTTaWobiyoxfGsFg3BdEsYn/QZUMBa/T7mWTFN2NrM3+yVwPCGl97b1uBq49jU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778680417; c=relaxed/simple; bh=DfMSq3/fpB55C2Zq/CACYZ6cbMhEiqg14W9TtrUOK9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bhjp+X7LNx/FnJ+TyIo7INOf3VsF4d2k4ucP1oopk3Fb6uz4Ftws+asn/x0fUCQFuxTNJIwPk3dYMs8SSbHS4wxET2JfdtL18w6exIYa1BEj+dLyhu5bIMw7Pt+GimExm3JWp82tOd32sZeXieyi/D72DGCsz7U1JTr+PO1LWuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IBurM51n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IBurM51n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56F7FC2BCF7; Wed, 13 May 2026 13:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778680417; bh=DfMSq3/fpB55C2Zq/CACYZ6cbMhEiqg14W9TtrUOK9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBurM51nwoA0Vog5c4SbiBeCDbxNpW2oAm11vQ/1LjWiDcAaO5ZERlXVNvr5Yvzb+ E6EAuInwO+pKqgfUKUTsHC0K1EWlXHRvTqwhdPjvj1UoG+c5M9u2YbwYr24r7PPKM7 pWzBzu059ZUQFaknvvyKd2QgR9PAh4usx/KF4BPphQ+l9Ad4LPwSgl+oqKlMXcItoi RFD27t3QBFEZaEpPLjDoqLlozaiJRcsu1GsyzFOD7i9BynoNJdAIiJ3+SoSdzJe7Ro XNIalvoktl1KJS2ldzbMHGhX/OtrO1z1s/Togij0rVmVs/LZiD1TEjYNh9L1VG8qCe YPQ+fal7deeow== From: Sasha Levin To: stable@vger.kernel.org Cc: Selvarasu Ganesan , stable , Pritam Manohar Sutar , Thinh Nguyen , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.15.y] usb: dwc3: Move GUID programming after PHY initialization Date: Wed, 13 May 2026 09:53:34 -0400 Message-ID: <20260513135334.3740565-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051247-obligate-coping-ebad@gregkh> References: <2026051247-obligate-coping-ebad@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Selvarasu Ganesan [ Upstream commit aad35f9c926ec220b0742af1ada45666ae667956 ] 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 Reported-by: Pritam Manohar Sutar Signed-off-by: Selvarasu Ganesan Acked-by: Thinh Nguyen Link: https://patch.msgid.link/20260417063314.2359-1-selvarasu.g@samsung.com Signed-off-by: Greg Kroah-Hartman [ adapted dwc3_writel(dwc, ...) to dwc3_writel(dwc->regs, ...) ] Signed-off-by: Sasha Levin --- 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 c9966b0161907..63a8528da1ba6 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -978,12 +978,6 @@ static 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->regs, DWC3_GUID, LINUX_VERSION_CODE); - ret = dwc3_phy_setup(dwc); if (ret) goto err0; @@ -1023,6 +1017,12 @@ static int dwc3_core_init(struct dwc3 *dwc) if (ret) goto err1; + /* + * 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->regs, DWC3_GUID, LINUX_VERSION_CODE); + dwc3_core_setup_global_control(dwc); dwc3_core_num_eps(dwc); -- 2.53.0