Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4762080pxb; Sun, 14 Feb 2021 23:56:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwNm3J00U/H60SEW4axORIA6xoG8jKGp1rBPR5uFyzBiAZzxKO7hTypI7qqa7Bcl5n32yO X-Received: by 2002:a17:906:85cd:: with SMTP id i13mr2018055ejy.448.1613375798209; Sun, 14 Feb 2021 23:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613375798; cv=none; d=google.com; s=arc-20160816; b=lIrOvHteq7M3Ko1RFPtOp/ROzInDki94k0NHij4E2Y0LjhQcMUadG5kLF+O2a24xQq 1Z98ajxTaaHA89i14FypELURLkFsWf86p98ZcPd1XKZCjEoiuoVfjox4ipP21IIbSkuR wO09PHlcxsEP5rNjiF7uG/tiJ5yIpshW5oBxj5mXMtQEhtHP9Tj7Y7DEFyGKnivolLgr UhiYhfflS1FNL2cVPOsZeqyLZGsYoG5yJ9dpVc8Zm7ChY5uIyCan9Kqs76CC8sdEcwJR +mQ6kCO1nRCyKQSabT3CdoNkqcdUlfGAyehSldVbiJ+ZSye/TE5E2KEUm+dJZgtQr8hq n9lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:to:subject:dkim-signature; bh=WDFAfN0/BngAiZ8QhhfDwFmcBbrp6aqzidWsx+GK2iQ=; b=UtbOLY/51wXSCJy2H0vnafnmU+JnmU7xvGNBznr9kj5hEoZghFZKr3Sx+ztQFQWFv/ BXd4a5FvHu0OSYyDiFHIdvzJWKImwwH0PwoMEFEkbJsqO89WBkRL8DsTyGpFlF7RvqHM 30WYSJTlqtyhHl8uXot5Bvc3BaZBRYMATNz6P4SGS+Ds9JlxrJSviOmbu+0G9blZJ+XZ Jcspke5Rk/iuDoCLz7ko+NSsNfNK0QLnd0wWQJEIaXsNRxFLpkYR5i7p5xmuu/GtsSb7 IozxbU6nSM6u6/yFElNfyWGZ/km/ZB0ZEFDNZMqFLjwGe980EKk68bj4fKm9DzjUodu5 q7Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HFne1yf8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si12209031edy.17.2021.02.14.23.56.15; Sun, 14 Feb 2021 23:56:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HFne1yf8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbhBOHzi (ORCPT + 99 others); Mon, 15 Feb 2021 02:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbhBOHzg (ORCPT ); Mon, 15 Feb 2021 02:55:36 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABFA9C061756; Sun, 14 Feb 2021 23:54:55 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id p21so8708417lfu.11; Sun, 14 Feb 2021 23:54:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:organization:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WDFAfN0/BngAiZ8QhhfDwFmcBbrp6aqzidWsx+GK2iQ=; b=HFne1yf8n/jjGu79UZRlMh3uu5FpXp8TMGHkMHNxCxgXRklLbNHiNooISp0Gd/5TSj iLcz3Ed78Ea1lI5Uc52qo6TlDm9egiUn1H01qCMfZLGWat4jqyoJh0gRzs6sPVZeNnNQ xdcUMDLYkxv5pMgIlqa4y40xaEBGLPZ4uB1g0vF7sxSbQLJjMA1bMmips3tc8Ge3RGTs 6rpf0l7DXUo5ltB2qYHtwvfvyKC0tp+OxEGFfvfatS0xc/bHwV19NJCvWew/bEX7CLy2 tkjmdJvRYtW9dEguJoR8QUPzzgxq+biSK/zFHqBevbGA0+rXwiN2Zx0He7cdhilEOpXd CgJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=WDFAfN0/BngAiZ8QhhfDwFmcBbrp6aqzidWsx+GK2iQ=; b=rd68AQCZZOIiAjwnuiX++hH7EqbA7LmtBbuM3wa7PRpd9S/V5lEl7VT87m11ZMowlL ykgMxFkMWOHSPLosDFwzIy2DJ48Cuq6hh/yo28GlusG2GYJ6XKOr9n6XLJbKtku6mbth Rn5m/w6vat1kMqnXMlzJWQbEoQOnO98Bctwkypryg2maRUtMUzOkCvf24AbW0PjqZsdB 38sVgxhQeQltIQDDQT+hJ2w+ojrQnLe7ehE+MieX6EKZ/ZoHbL5n5T9g5d9v3aMZ22BC lo8PoO195MnAjt7aJJvPtSHUqqiVDgzAXGfc0D+PDrEE0UZgdsH0i42O85keC17Z9Oy6 AZFg== X-Gm-Message-State: AOAM530pyS3bVA0099Fy8T993b07zmQ/sjijsPfiYCbTlYexA8g79dES BUTcFXi6WiEnfii2YGrU8ttU6TP7Gyw= X-Received: by 2002:ac2:43d2:: with SMTP id u18mr7881922lfl.439.1613375694123; Sun, 14 Feb 2021 23:54:54 -0800 (PST) Received: from [192.168.1.100] ([178.176.74.220]) by smtp.gmail.com with ESMTPSA id u23sm522525ljd.28.2021.02.14.23.54.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Feb 2021 23:54:53 -0800 (PST) Subject: Re: usb: dwc3: gadget: Change runtime pm function for DWC3 runtime suspend To: Daehwan Jung , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <1613356739-91734-1-git-send-email-dh10.jung@samsung.com> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: Date: Mon, 15 Feb 2021 10:54:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1613356739-91734-1-git-send-email-dh10.jung@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 15.02.2021 5:38, Daehwan Jung wrote: > It seems pm_runtime_put calls runtime_idle callback not runtime_suspend callback. > It's better to use pm_runtime_put_sync_suspend to allow DWC3 runtime suspend. > > Signed-off-by: Daehwan Jung > --- > drivers/usb/dwc3/gadget.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index aebcf8e..4a4b93b 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -2229,7 +2229,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) > */ > ret = pm_runtime_get_sync(dwc->dev); > if (!ret || ret < 0) { BTW, this can be shortened to (ret <= 0)... > - pm_runtime_put(dwc->dev); > + pm_runtime_put_sync_suspend(dwc->dev); > return 0; > } > MBR, Sergei