linux/drivers/usb/dwc3
Thinh Nguyen fd2304f4c0 usb: dwc3: Properly set system wakeup
commit f9aa41130a upstream.

If the device is configured for system wakeup, then make sure that the
xHCI driver knows about it and make sure to permit wakeup only at the
appropriate time.

For host mode, if the controller goes through the dwc3 code path, then a
child xHCI platform device is created. Make sure the platform device
also inherits the wakeup setting for xHCI to enable remote wakeup.

For device mode, make sure to disable system wakeup if no gadget driver
is bound. We may experience unwanted system wakeup due to the wakeup
signal from the controller PMU detecting connection/disconnection when
in low power (D3). E.g. In the case of Steam Deck, the PCI PME prevents
the system staying in suspend.

Cc: stable@vger.kernel.org
Reported-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Closes: https://lore.kernel.org/linux-usb/70a7692d-647c-9be7-00a6-06fc60f77294@igalia.com/T/#mf00d6669c2eff7b308d1162acd1d66c09f0853c7
Fixes: d07e8819a0 ("usb: dwc3: add xHCI Host support")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Tested-by: Sanath S <Sanath.S@amd.com>
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://lore.kernel.org/r/667cfda7009b502e08462c8fb3f65841d103cc0a.1709865476.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:28:59 +02:00
..
core.c usb: dwc3: Properly set system wakeup 2024-04-03 15:28:59 +02:00
core.h usb: dwc3: Properly set system wakeup 2024-04-03 15:28:59 +02:00
debug.h usb: dwc3: Add function suspend and function wakeup support 2023-03-29 10:27:01 +02:00
debugfs.c usb: dwc3: debugfs: Resume dwc3 before accessing registers 2023-05-13 17:56:22 +09:00
drd.c usb: dwc3: Fix default mode initialization 2023-12-03 07:33:10 +01:00
dwc3-am62.c usb: dwc3-am62: Disable wakeup at remove 2024-04-03 15:28:25 +02:00
dwc3-exynos.c usb: dwc3: exynos: Add support for Exynos850 variant 2023-08-22 14:47:22 +02:00
dwc3-haps.c
dwc3-imx8mp.c usb: dwc3: remove unnecessary platform_set_drvdata() 2023-08-22 14:45:19 +02:00
dwc3-keystone.c usb: dwc3: remove unnecessary platform_set_drvdata() 2023-08-22 14:45:19 +02:00
dwc3-meson-g12a.c usb: dwc3: meson-g12a: do post init to fix broken usb after resumption 2023-08-22 14:44:09 +02:00
dwc3-octeon.c just cleanups and fixes 2023-09-07 10:35:14 -07:00
dwc3-of-simple.c usb: dwc3: dwc3-octeon: Convert to glue driver 2023-08-04 14:52:15 +02:00
dwc3-omap.c usb: dwc3-omap: Convert to platform remove callback returning void 2023-05-28 12:36:24 +01:00
dwc3-pci.c usb: dwc3: pci: add support for the Intel Arrow Lake-H 2024-02-16 19:10:55 +01:00
dwc3-qcom.c USB: dwc3: qcom: fix wakeup after probe deferral 2023-12-03 07:33:10 +01:00
dwc3-st.c usb: dwc3-st: Convert to platform remove callback returning void 2023-05-28 12:36:24 +01:00
dwc3-xilinx.c usb: dwc3-xilinx: Convert to platform remove callback returning void 2023-05-28 12:36:24 +01:00
ep0.c usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart 2024-01-25 15:35:42 -08:00
gadget.c usb: dwc3: Properly set system wakeup 2024-04-03 15:28:59 +02:00
gadget.h
host.c usb: dwc3: Properly set system wakeup 2024-04-03 15:28:59 +02:00
io.h
Kconfig usb: dwc3: dwc3-octeon: Convert to glue driver 2023-08-04 14:52:15 +02:00
Makefile usb: dwc3: dwc3-octeon: Convert to glue driver 2023-08-04 14:52:15 +02:00
trace.c
trace.h usb: dwc3: change some trace event __dynamic_array() to __get_buf() 2023-03-09 15:35:03 +01:00
ulpi.c