Skip to content

Commit

Permalink
usb: mtu3: fix failed runtime suspend in host only mode
Browse files Browse the repository at this point in the history
[ Upstream commit 1c703e2 ]

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: 6b58739 ("usb: mtu3: support suspend/resume for dual-role mode")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reported-by: Tianping Fang <tianping.fang@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220929064459.32522-1-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Chunfeng Yun authored and gregkh committed Oct 21, 2022
1 parent a97b792 commit 27b0f1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/usb/mtu3/mtu3_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/mtu3/mtu3_plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27b0f1e

Please sign in to comment.