From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC622C433B4 for ; Mon, 3 May 2021 04:33:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DC5361152 for ; Mon, 3 May 2021 04:33:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbhECEeh (ORCPT ); Mon, 3 May 2021 00:34:37 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:57978 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbhECEeh (ORCPT ); Mon, 3 May 2021 00:34:37 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620016424; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=8fqgfcxpLNEW6FbHlX0bNagmykdQF7/5MSAweBJIB9g=; b=IfOreC5YvWEIg9CFnw2Od8y1fSfly/uRjUx2nsbirL4sKrQtUypMyfk6lX/1jwm9FC8TbfLl oREOkkXB42US74oHiIhrTjeIbaFaWv6kkisVCbVRqeEzTmXEeE4N0NYzygItgaeFGHcPnXF0 Rb8LD9qYmMcVASr0MFdJmGMzI70= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyIxZTE2YSIsICJsaW51eC11c2JAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 608f7d27215b831afb991e3f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 03 May 2021 04:33:43 GMT Sender: sanm=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BDBEBC4323A; Mon, 3 May 2021 04:33:43 +0000 (UTC) Received: from [192.168.0.104] (unknown [124.123.183.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sanm) by smtp.codeaurora.org (Postfix) with ESMTPSA id 192DFC433F1; Mon, 3 May 2021 04:33:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 192DFC433F1 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=sanm@codeaurora.org Subject: Re: [PATCH v7 2/5] usb: dwc3: core: Host wake up support from system suspend To: Felipe Balbi , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Stephen Boyd , Doug Anderson , Matthias Kaehlcke Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Manu Gautam References: <1619586716-8687-1-git-send-email-sanm@codeaurora.org> <1619586716-8687-3-git-send-email-sanm@codeaurora.org> <87r1iuk9vs.fsf@kernel.org> From: Sandeep Maheswaram Message-ID: <184ddea9-643f-91ea-6d1f-5bdd26373e53@codeaurora.org> Date: Mon, 3 May 2021 10:03:36 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <87r1iuk9vs.fsf@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 4/28/2021 3:29 PM, Felipe Balbi wrote: > Hi, > > Sandeep Maheswaram writes: >> Avoiding phy powerdown when wakeup capable devices are connected >> by checking phy_power_off flag. >> 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 >> Reviewed-by: Matthias Kaehlcke >> --- >> 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 b6e53d8..bb414c3 100644 >> --- a/drivers/usb/dwc3/core.c >> +++ b/drivers/usb/dwc3/core.c >> @@ -1738,7 +1738,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) && dwc->phy_power_off) { > should be able to detect this generically, no? Shouldn't > device_may_wakeup() be valid here and give you the answer you want? I thinkĀ  device_may_wakeup() gives whether the controller is wake up capable or not. But we want to keep phy powered on only when some wakeup capable devices (eg:keyboard ,mouse ) are connected to controller.