usb: mtu3: condition PHY wakeup for host mode and runtime suspend

Host bus activity during gadget mode system suspend can trigger
unexpected system wakeups via interrupts because PHY wakeup is enabled
unconditionally.

Improve the suspend flow by conditioning PHY wakeup setup on
device_may_wakeup() and restricting it to host mode or runtime suspend
to ensure proper wakeup handling in gadget mode.

Signed-off-by: Fei Shao <fshao@chromium.org>
Link: https://patch.msgid.link/20260626082218.2750459-3-fshao@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Fei Shao 2026-06-26 16:21:52 +08:00 committed by Greg Kroah-Hartman
parent e69027c253
commit 2fe9a76eb3

View File

@ -544,7 +544,8 @@ static int mtu3_suspend_common(struct device *dev, pm_message_t msg)
ssusb_phy_power_off(ssusb);
clk_bulk_disable_unprepare(BULK_CLKS_CNT, ssusb->clks);
ssusb_wakeup_set(ssusb, true);
if (device_may_wakeup(dev) && (ssusb->is_host || PMSG_IS_AUTO(msg)))
ssusb_wakeup_set(ssusb, true);
return 0;
sleep_err: