Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2662261pxp; Tue, 22 Mar 2022 03:34:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwoINm/po5CFtEUWsoomR1l+RnhLDDpxYE/eYHfnN6E1UV2dsxdnLcn75tUVIYRSpBPqvc X-Received: by 2002:a63:4e5d:0:b0:381:f11:59f6 with SMTP id o29-20020a634e5d000000b003810f1159f6mr21465727pgl.565.1647945243988; Tue, 22 Mar 2022 03:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647945243; cv=none; d=google.com; s=arc-20160816; b=Yz/vQEYYeSLhOeA2FDQ1yj5s7Ig3TLr5WlAYYNF0v0d7SGRcT26eggx0TJ3LJ2BlBs 7RMeNRMKgmP0pbH48KCqa+nrfJ2hQGHDYY8Mjuud4fNndFOdVUcgVBWWaVrXZx6iGoM9 IuYIoLNKlnGXbKAQ9AVjVDcmxXwFAjYAj3eh3xZRwlw/N2jiw00dkYGw2H+AnUuDjuYz aIubunxDbEj30tjpcrDf7cDNhzkuKIXOSXksRmxr7FKt94tcQ3xw25zQiXI7Qnm/cjxu dY2uQlBYyuKQ3hzTtej6Wq2Nvep3CqnyN4TEFP6ddZU8MCOE9nlYvP0ifVEotmqBwHr5 ephw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nijQD/zlc5+xUJ+OIlvFTQfbS4iCg/CX/NvW4jL1NHY=; b=XhYoL1D6SEgehvh9QXzP0tuPSoMoLfpDN/IkHzFo9MZRZ9mxg9CNmHZQtu3tFrjswt DTjxRXu67wnR0sJBe9nfFnu+Hc4zFsVTMjN37jNZO0bKauzKHBMg2WOM5Xq4uIVfojlh Jcte2MiRmHq2AB3TMYFVAAra4Owj4Sy/U2pkF1tJYRVgoOTcg4/qLRfJDQwFT8pJM2qX N48XTyipQE1apmZeoxT5SxAQWZsycQ1wt8cmkg0phUf9DpMX8U+mzUSJk6NGQQoKd+Lo blVq5vInYGyLfuT9AIXUxC/JlVZckdiqs0xnQ3aF9Uh2f0/hb40AA9I7YWOYNHAD5h3+ CS5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=IzRqD4+B; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x42-20020a056a0018aa00b004faa7fa9503si4759965pfh.40.2022.03.22.03.33.51; Tue, 22 Mar 2022 03:34:03 -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=@quicinc.com header.s=qcdkim header.b=IzRqD4+B; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbiCVImm (ORCPT + 99 others); Tue, 22 Mar 2022 04:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbiCVImh (ORCPT ); Tue, 22 Mar 2022 04:42:37 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C99CE6BDD1; Tue, 22 Mar 2022 01:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647938468; x=1679474468; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=nijQD/zlc5+xUJ+OIlvFTQfbS4iCg/CX/NvW4jL1NHY=; b=IzRqD4+BN1Gtp9FKWKiOZhFBtwvOfvmSEVP1nJgYpo3uTFgy7ffMGfO9 hBD6hpnVODEwMrBUByswgbZXhtl72OPz7S9Z/9IVxD+SFVB/qc9AbtbKo bfQ0fBiXmepuX9wDVK7e8rBeHeKYd1UuLxiFx5kMneEFqRy0wJSr1+ygg 8=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 22 Mar 2022 01:41:08 -0700 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; 22 Mar 2022 01:41:08 -0700 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.986.22; Tue, 22 Mar 2022 01:41:07 -0700 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.986.22; Tue, 22 Mar 2022 01:41:03 -0700 Date: Tue, 22 Mar 2022 14:10:59 +0530 From: Pavan Kondeti To: Pavan Kondeti CC: Sandeep Maheswaram , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , , , , , Subject: Re: [PATCH v11 2/5] usb: dwc3: core: Host wake up support from system suspend Message-ID: <20220322084059.GN23316@hu-pkondeti-hyd.qualcomm.com> References: <1647932876-23249-1-git-send-email-quic_c_sanm@quicinc.com> <1647932876-23249-3-git-send-email-quic_c_sanm@quicinc.com> <20220322083221.GJ23316@hu-pkondeti-hyd.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220322083221.GJ23316@hu-pkondeti-hyd.qualcomm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Sandeep, On Tue, Mar 22, 2022 at 02:02:21PM +0530, Pavan Kondeti wrote: > Hi Sandeep, > > On Tue, Mar 22, 2022 at 12:37:53PM +0530, Sandeep Maheswaram wrote: > > During suspend read the status of all port and make sure the PHYs > > are in the correct mode based on current speed. > > Phy interrupt masks are set based on this mode. Keep track of the mode > > of the HS PHY to be able to configure wakeup properly. > > > > Also check during suspend if any wakeup capable devices are > > connected to the controller (directly or through hubs), if there > > are none set a flag to indicate that the PHY is powered > > down during suspend. > > > > Signed-off-by: Sandeep Maheswaram > > --- > > drivers/usb/dwc3/core.c | 54 ++++++++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 45 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > > index 1170b80..232a734 100644 > > --- a/drivers/usb/dwc3/core.c > > +++ b/drivers/usb/dwc3/core.c > > @@ -32,12 +32,14 @@ > > #include > > #include > > #include > > +#include > > > > #include "core.h" > > #include "gadget.h" > > #include "io.h" > > > > #include "debug.h" > > +#include "../host/xhci.h" > > > > #define DWC3_DEFAULT_AUTOSUSPEND_DELAY 5000 /* ms */ > > > > @@ -1861,10 +1863,36 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc) > > return ret; > > } > > > > +static void dwc3_set_phy_speed_mode(struct dwc3 *dwc) > > +{ > > + > > + int i, num_ports; > > + u32 reg; > > + struct usb_hcd *hcd = platform_get_drvdata(dwc->xhci); > > + struct xhci_hcd *xhci_hcd = hcd_to_xhci(hcd); > > + > > + dwc->hs_phy_mode = 0; > > + Sorry, My bad. I did not notice that the flags are cleared here. Thanks, Pavan