mirror-linux/drivers/usb/dwc2
Jisheng Zhang 2b94b054ac usb: dwc2: fix hang during suspend if set as peripheral
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 the dwc2_suspend() tries to read the dwc2's reg to check whether
is_device_mode or not, this would result in hang during suspend if dwc2
is configured as peripheral mode.

Fix this hang by bypassing suspend/resume if lowlevel hw isn't
enabled.

Fixes: 09a75e8577 ("usb: dwc2: refactor common low-level hw code to platform.c")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20251104002503.17158-3-jszhang@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-21 15:10:38 +01:00
..
Kconfig usb: use "prompt" instead of "bool" for choice prompts 2024-11-04 17:53:09 +09:00
Makefile
core.c usb: dwc2: Implement recovery after PM domain off 2025-02-19 15:15:54 +01:00
core.h usb: dwc2: Implement recovery after PM domain off 2025-02-19 15:15:54 +01:00
core_intr.c Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
debug.h
debugfs.c usb: dwc2: debugfs: Print parameter no_clock_gating 2024-07-31 10:47:10 +02:00
drd.c usb: dwc2: drd: fix clock gating on USB role switch 2024-09-11 15:35:33 +02:00
gadget.c usb: dwc2: gadget: Fix enter to hibernation for UTMI+ PHY 2025-07-13 17:31:04 +02:00
hcd.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hcd.h
hcd_ddma.c usb: dwc2: host: Fix dereference issue in DDMA completion flow. 2024-04-09 17:29:38 +02:00
hcd_intr.c USB: dwc2: write HCINT with INTMASK applied 2023-11-21 15:30:27 +01:00
hcd_queue.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hw.h Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
params.c usb: dwc2: Add support for 'maximum-speed' property 2025-09-12 14:03:10 +02:00
pci.c usb: dwc2: add pci_device_id driver_data parse support 2023-08-22 14:49:12 +02:00
platform.c usb: dwc2: fix hang during suspend if set as peripheral 2025-11-21 15:10:38 +01:00