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 53BA533372B; Fri, 9 Jan 2026 12:31:08 +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=1767961868; cv=none; b=RWowT/8bl1XMSuKOtUQk16VUdHcJUdJis5YnRJdJcdWZM7v4Q7tnXlpZmYZBZBRIge7jOXOA1VYn/MticWX0259XWP2w3G+rWTrZJpH91p4vBtrUx/YkKkeh6FbVffsHBlKkdTrDvtAW1dMhw+DpLpJqv2ww9POELGLNpLmFhVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961868; c=relaxed/simple; bh=mC9MQlLy2du+praLu54r8wWBeFK1t/XodfWe/V9Dmks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qKWA1gdA4BZh+zaKWge44d/EuM/eM6nt9sVzVP+NTTEc+AQHUXRbIOxZruxRDGt/LyP0IXwlNKSJPlJGSxQSxl+I5Rforhb0XWYJVcd6Z9Ujzd91dht0gzLWQ4VNI3wmEYMxHT1z4MrS/MJs2rqM93zhz88oVO7SwLgce0aoC6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J741Dagv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J741Dagv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5DE7C4CEF1; Fri, 9 Jan 2026 12:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961868; bh=mC9MQlLy2du+praLu54r8wWBeFK1t/XodfWe/V9Dmks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J741Dagv7Sej5mc2wLm8fjE+gUe8hDyi8PIQWYJry7Wze0QlIOFJ62zbBPMt0qa7O mIivn1Cbh2VoighyKCp7mNqO7xdhEiUu/0NkNHKAM0EdaBt7k9mUTt2sf4HqeOE+Pv 3t+CTx+zXX/+BZF3P6wYpbIdakvMF3cBB/KMsVd0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jisheng Zhang , Sasha Levin Subject: [PATCH 6.1 137/634] usb: dwc2: fix hang during shutdown if set as peripheral Date: Fri, 9 Jan 2026 12:36:55 +0100 Message-ID: <20260109112122.610788855@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jisheng Zhang [ Upstream commit b6ebcfdcac40a27953f052e4269ce75a18825ffc ] dwc2 on most platforms needs phy controller, clock and power supply. All of them must be enabled/activated to properly operate. If dwc2 is configured as peripheral mode, then all the above three hardware resources are disabled at the end of the probe: /* Gadget code manages lowlevel hw on its own */ if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) dwc2_lowlevel_hw_disable(hsotg); But dwc2_driver_shutdown() tries to disable the interrupts on HW IP level. This would result in hang during shutdown if dwc2 is configured as peripheral mode. Fix this hang by only disable and sync irq when lowlevel hw is enabled. Fixes: 4fdf228cdf69 ("usb: dwc2: Fix shutdown callback in platform") Signed-off-by: Jisheng Zhang Link: https://patch.msgid.link/20251104002503.17158-2-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc2/platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5e8c74e20bffa..8e80b20361e3a 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -338,11 +338,11 @@ static void dwc2_driver_shutdown(struct platform_device *dev) { struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); - dwc2_disable_global_interrupts(hsotg); - synchronize_irq(hsotg->irq); - - if (hsotg->ll_hw_enabled) + if (hsotg->ll_hw_enabled) { + dwc2_disable_global_interrupts(hsotg); + synchronize_irq(hsotg->irq); dwc2_lowlevel_hw_disable(hsotg); + } } /** -- 2.51.0