From patchwork Wed Oct 19 08:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp316031wrs; Wed, 19 Oct 2022 06:07:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WqrfKQKvX4HRPkk7+of3d95Mfm3YeF4/ZD2h24jdtKoj067+T9ZHBb/IU3MkqMHf//DCL X-Received: by 2002:a17:90a:4f02:b0:20b:5fe6:6125 with SMTP id p2-20020a17090a4f0200b0020b5fe66125mr45791606pjh.215.1666184828934; Wed, 19 Oct 2022 06:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666184828; cv=none; d=google.com; s=arc-20160816; b=ltXkDIMD0HmWjjYmiCraCzTbpz5BUrrUJYz7VhHainEVkd4PYEcLZMp3aJHa0MOqf0 HoLgOPHMzNsw4i3tX0RRGtyqAGD7pwjkm89j6Wpl2aiUyU9QhM2k0WNqQuzxV9MRi1D4 9GMiIpVOWocoz6io4XuGX9CO4R2ZgMRBAaPE+x5DvekBqTHU7aCyCZFARa1pOapbGajB qLYQTofiq49D4qCT9PjPgeoRxxq+rGqx/8ko99vlefzAzcPmEbCRpCMlnAkW3zDm8BRl 7IS7OKeOMTRtxhwkAyy7odRB2g3mI/W9G3Rb5CEYEu5fu8x/eGaBWvjIO/oAb9g230J+ u9Gw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a17090311ce00b001789fa8f90esi21053918plh.408.2022.10.19.06.06.38; Wed, 19 Oct 2022 06:07:08 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747121423111372559?= X-GMAIL-MSGID: =?utf-8?q?1747121423111372559?= 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;