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 91FF71F9F70; Sun, 1 Mar 2026 01:26:03 +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=1772328363; cv=none; b=G+8qu1mM6cC3+nOS8mGEZwm0kKapCb+autoHoRzf8Z+vMS3YMhvfHyaCUug+rfBqe7MWLJbjhmCiCEGS8aeye6/lO/j4T42CiOA4MLpU33xoQs4cjg5kmZ8LnFm34ZW3HgjP4Nnp8qDjVSPe4yqQZjNS6B+Fmt+XPKtgaZGaBSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328363; c=relaxed/simple; bh=lTUvn597iCBFVcfGwIAqC7pBe9DN++a0LDbHXHKAKFU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=R32mZjZ498G4xcahwvxRQFdf3KuWykm503HY1OHoC+Lf6ByGJh9LfaHcG/DieQkFyYZKMiUByUpJPloLhOYi0oD8ZBhlbGgnH2yzFokmqixUdj6gtyei2EAvy0mVdNM7qqWWDqgrpyyh5sxmle9PEqvguzuwnDUf4GwW0h7JSYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Czlm4l2T; 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="Czlm4l2T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD57FC19421; Sun, 1 Mar 2026 01:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772328363; bh=lTUvn597iCBFVcfGwIAqC7pBe9DN++a0LDbHXHKAKFU=; h=From:To:Cc:Subject:Date:From; b=Czlm4l2TVCNHOIyXaFgFmGAJ3ht5+zxIEzPHqdAB5+AnoQJ8sHYqEsq3bZQEdwZ7R LxRHOjKPlVa8JlIBCapD9gNqfGDhXtrYZNn21ZKofsG7jvQo2dEHEm1iGeXh2neiMy MKvRjFWcPFI2Fop86AkF+sCiRgC59w7Efmifj4OuSMSW4bjn8pV6Ka3BfkqqasfVoY vEWe5qV/Ly8U9rMF6asGtCFVoScCa4NsMCRVxVuoFmc93ZNbSdVZ667ta/WTvfLaWB I+jKmDfF++4/LqUEF7T3b2CUHtf+Pwh9vb6xga4UAJ1tefc/Np0ulbeXI3Cr5d9/eU kj9xSOQGWWwKg== From: Sasha Levin To: stable@vger.kernel.org, jszhang@kernel.org Cc: stable , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: FAILED: Patch "usb: dwc2: fix resume failure if dr_mode is host" failed to apply to 6.12-stable tree Date: Sat, 28 Feb 2026 20:26:01 -0500 Message-ID: <20260301012601.1683328-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From a52e4f2dff413b58c7200e89bb6540bd995e1269 Mon Sep 17 00:00:00 2001 From: Jisheng Zhang Date: Thu, 29 Jan 2026 10:15:34 +0800 Subject: [PATCH] usb: dwc2: fix resume failure if dr_mode is host commit 13b1f8e25bfd1 ("usb: dwc2: Force mode optimizations") removed the dwc2_force_mode(hsotg, true) in dwc2_force_dr_mode() if dr_mode is host. But this brings a bug: the controller fails to resume back as host, further debugging shows that the controller is resumed as peripheral. The reason is dwc2_force_dr_mode() missed the host mode forcing, and when resuming from s2ram, GINTSTS is 0 by default, dwc2_is_device_mode in dwc2_resume() misreads this as the controller is in peripheral mode. Fix the resume failure by adding back the dwc2_force_mode(hsotg, true). Then an obvious question is: why this bug hasn't been observed and fixed for about six years? There are two resons: most dwc2 platforms set the dr_mode as otg; Some platforms don't have suspend & resume support yet. Fixes: 13b1f8e25bfd1 ("usb: dwc2: Force mode optimizations") Cc: stable Signed-off-by: Jisheng Zhang Link: https://patch.msgid.link/20260129021534.10411-1-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index c3d24312db0fe..f375c5185bfe2 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -578,6 +578,7 @@ void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg) { switch (hsotg->dr_mode) { case USB_DR_MODE_HOST: + dwc2_force_mode(hsotg, true); /* * NOTE: This is required for some rockchip soc based * platforms on their host-only dwc2. -- 2.51.0