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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4805C433F5 for ; Wed, 17 Nov 2021 06:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A485C613D3 for ; Wed, 17 Nov 2021 06:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbhKQGF2 (ORCPT ); Wed, 17 Nov 2021 01:05:28 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:17269 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233492AbhKQGFG (ORCPT ); Wed, 17 Nov 2021 01:05:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1637128929; x=1668664929; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zjjG5wR5uHgr3YmxjNHMilgpmUQk8RzAtejYJxRqHYU=; b=e44eVum5ukbQ9lA1Cr4LBQK1qm7byD1IpC/e86Dxaakcs43KW+jrPHqr ZiggT0eet6jETzZNX96JU55N/I/q3VHq46gRBnap5cb81AVKSolhBd6Fp OXhsVThT9dohr6ONBNVRNfVpyxDV+kkBpnYqn9JFmd3f5tvDQoYFJpuj5 I=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 16 Nov 2021 22:02:05 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2021 22:02:04 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 16 Nov 2021 22:02:04 -0800 Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 16 Nov 2021 22:01:59 -0800 Date: Wed, 17 Nov 2021 11:31:55 +0530 From: Pavan Kondeti To: Sandeep Maheswaram CC: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , , , , , Subject: Re: [PATCH v9 2/5] usb: dwc3: core: Host wake up support from system suspend Message-ID: <20211117060155.GA7792@hu-pkondeti-hyd.qualcomm.com> References: <1635753224-23975-1-git-send-email-quic_c_sanm@quicinc.com> <1635753224-23975-3-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1635753224-23975-3-git-send-email-quic_c_sanm@quicinc.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sandeep, On Mon, Nov 01, 2021 at 01:23:41PM +0530, Sandeep Maheswaram wrote: > Avoiding phy powerdown when wakeup capable devices are connected > by checking wakeup property of xhci plat device. > Phy should be on to wake up the device from suspend using wakeup capable > devices such as keyboard and mouse. > > Signed-off-by: Sandeep Maheswaram > --- > drivers/usb/dwc3/core.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 643239d..a6ad0ed 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -1787,7 +1787,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) > dwc3_core_exit(dwc); > break; > case DWC3_GCTL_PRTCAP_HOST: > - if (!PMSG_IS_AUTO(msg)) { > + if (!PMSG_IS_AUTO(msg) && !device_may_wakeup(&dwc->xhci->dev)) { > dwc3_core_exit(dwc); > break; > } > @@ -1848,13 +1848,16 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) > spin_unlock_irqrestore(&dwc->lock, flags); > break; > case DWC3_GCTL_PRTCAP_HOST: > - if (!PMSG_IS_AUTO(msg)) { > + if (!PMSG_IS_AUTO(msg) && !device_may_wakeup(&dwc->xhci->dev)) { > ret = dwc3_core_init_for_resume(dwc); > if (ret) > return ret; > dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST); > break; > + } else { > + dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_HOST); > } > + During runtime resume, we enter else block and call dwc3_set_prtcap() which is not done before. Is that intentional? Thanks, Pavan