umber-kernel/drivers/usb
Jisheng Zhang 9799f97775 usb: dwc2: fix resume failure if dr_mode is host
[ Upstream commit a52e4f2dff413b58c7200e89bb6540bd995e1269 ]

commit 13b1f8e25b ("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: 13b1f8e25b ("usb: dwc2: Force mode optimizations")
Cc: stable <stable@kernel.org>
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20260129021534.10411-1-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:21:23 -05:00
..
atm
c67x00
cdns3 usb: cdns3: fix role switching during resume 2026-02-26 14:59:45 -08:00
chipidea usb: chipidea: udc: fix DMA and SG cleanup in _ep_nuke() 2026-03-04 07:20:35 -05:00
class
common
core
dwc2 usb: dwc2: fix resume failure if dr_mode is host 2026-03-04 07:21:23 -05:00
dwc3 usb: dwc3: gadget: Move vbus draw to workqueue context 2026-03-04 07:21:23 -05:00
early
fotg210
gadget usb: gadget: tegra-xudc: Add handling for BLCG_COREPLL_PWRDN 2026-03-04 07:21:18 -05:00
host usb: host: tegra: Remove manual wake IRQ disposal 2026-03-04 07:21:14 -05:00
image
isp1760
misc
mon
mtu3
musb
phy
renesas_usbhs
roles
serial
storage
typec usb: typec: ucsi: psy: Fix voltage and current max for non-Fixed PDOs 2026-03-04 07:20:32 -05:00
usbip
Kconfig
Makefile
usb-skeleton.c