]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc2: fix hang during shutdown if set as peripheral
authorJisheng Zhang <jszhang@kernel.org>
Tue, 4 Nov 2025 00:25:02 +0000 (08:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:32 +0000 (13:09 +0100)
commit316a067b27695db62ab52d65e9ffbfc7ca7b2238
treeb9bebc58aaec7d57111b36d9243c5320be26be6e
parent16514b403f0a54854b101d2503ef3b2a5d1d0726
usb: dwc2: fix hang during shutdown if set as peripheral

[ 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 <jszhang@kernel.org>
Link: https://patch.msgid.link/20251104002503.17158-2-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc2/platform.c