From nobody Fri Oct 17 10:15:18 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1229CC433FE for ; Wed, 19 Oct 2022 13:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbiJSNDV (ORCPT ); Wed, 19 Oct 2022 09:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbiJSNDC (ORCPT ); Wed, 19 Oct 2022 09:03:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4601BFFFB0; Wed, 19 Oct 2022 05:46:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id CF224CE2166; Wed, 19 Oct 2022 09:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C199EC433D6; Wed, 19 Oct 2022 09:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170267; bh=Abd8TtgViZsYRoO+q7ZGMnJJBXxq5ckWM858dKQWM9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kLG3n6M92XoH8R4lHRlqKp+1WUO9S/aH25AkN6hTIuzlsyqeYpHd/vKJxwIw+6uZy /pFB6m4KVf92eie4VwfzeLvGxmjnYi4n7md1xlFKmyMDmAnozXcxWS+L4+64WE3bda 26sGHv6dl/G3AHthpB7mW57WQ9zFGJC3aMMUuvSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, AngeloGioacchino Del Regno , Tianping Fang , Chunfeng Yun , Sasha Levin Subject: [PATCH 6.0 589/862] usb: mtu3: fix failed runtime suspend in host only mode Date: Wed, 19 Oct 2022 10:31:16 +0200 Message-Id: <20221019083315.995498897@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Chunfeng Yun [ Upstream commit 1c703e29da5efac6180e4c189029fa34b7e48e97 ] 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") Reviewed-by: AngeloGioacchino Del Regno Reported-by: Tianping Fang Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220929064459.32522-1-chunfeng.yun@mediate= k.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/mtu3/mtu3_core.c | 2 -- drivers/usb/mtu3/mtu3_plat.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) 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; } =20 - device_init_wakeup(dev, true); - /* power down device IP for power saving by default */ mtu3_stop(mtu); =20 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); =20 + device_init_wakeup(dev, true); + ret =3D ssusb_rscs_init(ssusb); if (ret) goto comm_init_err; --=20 2.35.1