From patchwork Sat Oct 22 07:25:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1123377wrr; Sat, 22 Oct 2022 02:33:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7F+Tivco1celGA2BtuX7JifWtnsny+GJ3HBzAJ9ZBir1lSJgJwtqBfSfmCuEcvfnhR53ye X-Received: by 2002:a17:907:7626:b0:78d:e65b:e5ac with SMTP id jy6-20020a170907762600b0078de65be5acmr18550177ejc.416.1666431197815; Sat, 22 Oct 2022 02:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666431197; cv=none; d=google.com; s=arc-20160816; b=fPw+ra3JRI4QdT4QxULllvRdSnEBmImYP22zYjEFnZz224ysvmzQJUU5UkDFda1zeA q5UCAHSo5N30gicp6+pmHUznIxDN3qsvfRDpAmbFfuPfc7OYoKj0AQqCWIh6yMGI9ywU JE/03I+jG+pGlGUtI4sb1oUcH7gPz+fUpyZo/6Es6/lp9JLJtx5YdVsAgkBIyurXXveB aXuVZ5nhPQQg0xsMo3DgTHhzTh21N6YdKzIIHYHlu0jNAndSc2IMtYyccO+P47itHqDd EYfsUh0yZ7aKgTPOc90k4XULchg9Sowtkw2lTaY8PYAnHn/u7ufsnmBO9XjR8DY5jf0g lM4A== 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=ABqLhEefk0LvQT+Xph82fNTgTbQEcZoMI1BaWLPqWcU=; b=iFT5eE54C2KK1e9+Q+dIqbW4WHumH+bELqRhGshbO26Ty+Un4lAmm5BABgg84f+Het so8aj3Sz4E6EzVwGuPutVxJcMKhIY7cdcDjF95TY6N2lGPCyUkSzSHyCV8vu9EEEhwgv OwJwTfETjUCtRKKeUiG7FxCytDeJbGPZg3WoIHw0xuL902vNC8L16f09kSsj2k7GA/6L XOPVdea8SJKC2O0pDRNtNf0wEtOUB/8h4Pm0jYYjc9TsstlHcSroR0HpMqn6aTJfprAa 1eErwPLgO4fvn+ujV3fLKRDv0tLFJSqniJh+HEOl8mrLpZFvYrqdtT6X81yW3HM6TfRU Lx8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mnIU7JR+; 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 ho31-20020a1709070e9f00b0078dcf17c084si25158879ejc.728.2022.10.22.02.32.49; Sat, 22 Oct 2022 02:33:17 -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=mnIU7JR+; 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 S231134AbiJVJQb (ORCPT + 99 others); Sat, 22 Oct 2022 05:16:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbiJVJP2 (ORCPT ); Sat, 22 Oct 2022 05:15:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 008D5836D3; Sat, 22 Oct 2022 01:30:05 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 801DB60B82; Sat, 22 Oct 2022 07:56:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86660C433D6; Sat, 22 Oct 2022 07:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425368; bh=vefNYbMf8Zt5bHYazbZqb/GZMUBayjSqs/8fWewmGmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mnIU7JR+HvttRpP+GvLGMuXJtjJbZiexV0TiQ4hyphL2WvgXZQYZOzZyZEgQU30PK sh4BQ1r9EpLfhuETkosvpgryU9lzXx76bbu0eeDNU8xhY53gwvll6utICPGohzeUvp x3eBmvQg4RK5kYytuNpkS20FU9zkvhuvIOZypjbE= 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 5.19 478/717] usb: mtu3: fix failed runtime suspend in host only mode Date: Sat, 22 Oct 2022 09:25:57 +0200 Message-Id: <20221022072519.497103600@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747379759607243928?= X-GMAIL-MSGID: =?utf-8?q?1747379759607243928?= 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 c4a2c37abf62..3ea5145a842b 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -971,8 +971,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 4309ed939178..845b25320fd2 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -332,6 +332,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;