Re: [RFC PATCH 1/1] usb: dwc3: qcom: Keep wakeup option default off
From: Krishna Kurapati
Date: Wed Nov 04 2026 - 08:58:24 EST
On 11/3/2026 11:44 AM, Peter Chen wrote:
The "wakeup-source" property, as described in
Documentation/devicetree/bindings/power/wakeup-source.txt, only says
that a device is capable of waking up the system. Whether wakeup is
actually enabled is a policy decision, and drivers use
device_may_wakeup() to decide whether to arm the hardware wakeup logic.
Currently dwc3-qcom calls device_init_wakeup(dev, true) when the
property is present, so USB wakeup is enabled by default and users who
do not want USB activity (e.g. connect/disconnect) to wake up the system
may have to disable it through power/wakeup, otherwise, unexpected wakeup
may happen.
Having wakeup enabled by default also costs power. In host mode,
when device_may_wakeup() is true, system suspend keeps the controller
and PHYs powered (dwc3_core_exit() is skipped and the genpd is not
powered off) so that the wakeup interrupts can fire, even on systems
where USB is never used as a wakeup source and could be fully powered
off.
For USB controllers, keep the wakeup option default off and only mark
the device as wakeup capable, so that the user decides which USB port
is used as a system wakeup source. Users who need it can enable it with:
echo enabled > /sys/devices/.../<dwc3 device>/power/wakeup
While at it, drop the local wakeup_source variable and use
device_property_read_bool() like the other property reads in probe.
++cros-qcom-dts-watchers since this is used in chromium userspace and modifications might be needed there as well.
Regards,
Krishna,
Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxxxxx>
---
drivers/usb/dwc3/dwc3-qcom.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 8116dc94c181..1451b5eaccce 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -653,7 +653,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
struct resource *r;
int ret;
bool ignore_pipe_clk;
- bool wakeup_source;
qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
if (!qcom)
@@ -757,8 +756,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
if (ret)
goto remove_core;
- wakeup_source = of_property_read_bool(dev->of_node, "wakeup-source");
- device_init_wakeup(&pdev->dev, wakeup_source);
+ if (device_property_read_bool(dev, "wakeup-source"))
+ device_set_wakeup_capable(dev, true);
qcom->is_suspended = false;