diff mbox series

[2/2] usb: mtu3: fix failed runtime suspend in host only mode

Message ID 20220928091721.26112-2-chunfeng.yun@mediatek.com (mailing list archive)
State Accepted
Commit 1c703e29da5efac6180e4c189029fa34b7e48e97
Headers show
Series [1/2] usb: mtu3: fix ep0's stall of out data stage | expand

Commit Message

Chunfeng Yun (云春峰) Sept. 28, 2022, 9:17 a.m. UTC
When the dr_mode is "host", after the host enter runtime suspend,
the mtu3 can't do it, because the mtu3's device wakeup function is
not enabled, instead it's enabled in gadget init function, to fix
the issue, init wakeup early in mtu3's probe()

Fixes: 6b587394c65c ("usb: mtu3: support suspend/resume for dual-role mode")
Reported-by: Tianping Fang <tianping.fang@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/mtu3/mtu3_core.c | 2 --
 drivers/usb/mtu3/mtu3_plat.c | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

AngeloGioacchino Del Regno Sept. 28, 2022, 1:43 p.m. UTC | #1
Il 28/09/22 11:17, Chunfeng Yun ha scritto:
> When the dr_mode is "host", after the host enter runtime suspend,
> the mtu3 can't do it, because the mtu3's device wakeup function is
> not enabled, instead it's enabled in gadget init function, to fix
> the issue, init wakeup early in mtu3's probe()
> 
> Fixes: 6b587394c65c ("usb: mtu3: support suspend/resume for dual-role mode")
> Reported-by: Tianping Fang <tianping.fang@mediatek.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff mbox series

Patch

diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index 0ca173af87bb..a3a6282893d0 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -978,8 +978,6 @@  int ssusb_gadget_init(struct ssusb_mtk *ssusb)
 		goto irq_err;
 	}
 
-	device_init_wakeup(dev, true);
-
 	/* power down device IP for power saving by default */
 	mtu3_stop(mtu);
 
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 4cb65346789d..d78ae52b4e26 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -356,6 +356,8 @@  static int mtu3_probe(struct platform_device *pdev)
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
+	device_init_wakeup(dev, true);
+
 	ret = ssusb_rscs_init(ssusb);
 	if (ret)
 		goto comm_init_err;