Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1110258rwi; Wed, 19 Oct 2022 06:53:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OUv4CbzQqjZLI1FZpynepiubXbUzH/ob/DIiqNy5D9Apfklattxpy/UaYVlvwaIG+9t7M X-Received: by 2002:a17:902:7c8c:b0:17f:7565:4a2d with SMTP id y12-20020a1709027c8c00b0017f75654a2dmr8783957pll.65.1666187625956; Wed, 19 Oct 2022 06:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187625; cv=none; d=google.com; s=arc-20160816; b=CtndnG4WsTtUbvPliyoxRVN7MPeujbzOvnmnZ1y2GfI38nkskcDwXcgXue8mPIJeeD TISvUX4n0N6CNSOldMciugsM+oDS9rx8MoU5Oo0fgym9OiE5LrMSxYmiPUqOk19x1r0O CQbPeqrW7qWg6Vx7q/V286BwukqW6uqziBuXGqMUTXSkyA+lihLfYtOaBwFYuMwkutyg kW+gGx0DiDgNIaXm+RRtaiumEu+dlywyvL+P2Q79o1bJYXQakFEcOht9bQCtzpc4Je5G H6Sc+4ehoNJAzbL3FWxKVzh1HCTIb/O0uoLwTcw/IIUCvBlv2KGCPkDRTgTby0mWVfRP k9qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2Ed1P69DOtdHJTl0zIgH4+dD+zLJET5lZmDNHPsV8Io=; b=V5B7am9psE7Kvuuc5uluPC46kythkGCadmzwZ1nkptYuXtMnb3v44tS0Hyz9532Nkk MCWIQ/t4m2Tn2mNP3xbS0DA2EeWDdYn3wa+cysg0q12lxoVwI4PeKSFc/HX/S2SsmkIP ORQPBdCwlXtUhqPsKQV9n2wscIuNQfusIB/QBWfyV/lUOif113HJo07Lab9IVBswQpZd wUauxo1v9En7utXf0CMmA+xsgGKhBt+d9nWJbMGNrA0scxzzo0ONAksH6vWhyCX7F/lp X85kGKyeclnonvcnFUS26EApkl6OFnPam8rlOZ7chFhBZy08tvUl6Xitf5QmtMosBs0t HRpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kLG3n6M9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a056a00081200b00565de49c28esi20543262pfk.57.2022.10.19.06.53.33; Wed, 19 Oct 2022 06:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kLG3n6M9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232318AbiJSNDV (ORCPT + 99 others); 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@mediatek.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; } - 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; -- 2.35.1