Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2649109pxp; Tue, 22 Mar 2022 03:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEji7Guo/4sobwk6vl/ACKJmxswODYhi8Z/XX9sHZ3U6p3CYVvwude1aR62B6SiKyrhmQV X-Received: by 2002:aa7:d403:0:b0:40f:739c:cbae with SMTP id z3-20020aa7d403000000b0040f739ccbaemr27689789edq.267.1647943973759; Tue, 22 Mar 2022 03:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647943973; cv=none; d=google.com; s=arc-20160816; b=JphqqDNizC92MusJcExBQDzVXq4k/etQwJibtQI7y1/lHO4cdFqQnVr6gMtq7D6wmv nJG6vW5mWM/vYxKVSTRXGPe1owc1mNfhCgpKozKhR6p06JKIgNHU7yGf5zWu+hjAGx/X aDN4MbwAtsBOWL/+yQkUWwx2zskhW/YaTDlpgLRgsIDPAmHjyOS6eixbzq0lctuL3cVi S9xA82VboXtXApSVKxmJrCml+T2fBzY/GcXWqcheX+tpvjx1BC1sITfjT9LDC3fIZJ41 7LtXERC2jNqIvdQD+D0VzNZ+FbIiQ9OO7CUAygLD7J49yBsLsTFdSh3XohfneSm2CjOs mqww== 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=311fvjJ4soaKRAT/+HaNbAabaAadMCX35bFpYRBPZoE=; b=vQ8s0IS1JctRZVYqHqyP5LFF9cfGpzXMd8/U3HFqbXf9PbHLN2d6F3NOym2Uw7C5+h ALkhzVGHtZWQemXZuKoiztx7hIfSAJtJLgAfPn6vyjV5+iTs4+2HBS9MgC/CUdmvRXiq HggIIvNhuw1cy9CvhoFe10pJIboG+XlVMl/ZwOKzhJYFuWdyX9W7PlxN6YDSZN6+D78s 3GEVUmQOgNr1YiSZFbK7yqIPONTcAR1D0MapuEN7v/uYCvxRrmq3HMTwzKlS/S8sgPWE hh/y0jZp87P/gVndUZgXUNgSy6B0RzpI7gh+QHJCkft/4YJNUgb0fxamdQ7oHh3onV09 wjTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=bHKMkjpV; 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 j24-20020a170906475800b006df8927010fsi8534276ejs.777.2022.03.22.03.12.17; Tue, 22 Mar 2022 03:12:53 -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=bHKMkjpV; 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 S231259AbiCVIfN (ORCPT + 99 others); Tue, 22 Mar 2022 04:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbiCVIfM (ORCPT ); Tue, 22 Mar 2022 04:35:12 -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 1CB2C31904; Tue, 22 Mar 2022 01:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647938024; x=1679474024; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=311fvjJ4soaKRAT/+HaNbAabaAadMCX35bFpYRBPZoE=; b=bHKMkjpVCcgmOVyDyobQ4vFS6Yq1wGd3NgL6w7uiLGLmkL+fQGfI/1am pKDfiUHCN/ml22HZ+z5ZfpdyE9GjeCaY8koqbBbCUwxd2ogSnf/tFj/tw 6RBRYVPsyg9rYwz50kV1tnyzmHVV+mP3hwwjkz4NilPf0CPQvO0Z1UY11 w=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 22 Mar 2022 01:33:43 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 01:33:43 -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:33:43 -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:33:38 -0700 Date: Tue, 22 Mar 2022 14:03:35 +0530 From: Pavan Kondeti To: Sandeep Maheswaram CC: Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , , , , , Subject: Re: [PATCH v11 3/5] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Message-ID: <20220322083335.GK23316@hu-pkondeti-hyd.qualcomm.com> References: <1647932876-23249-1-git-send-email-quic_c_sanm@quicinc.com> <1647932876-23249-4-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: <1647932876-23249-4-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: 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 On Tue, Mar 22, 2022 at 12:37:54PM +0530, Sandeep Maheswaram wrote: > Adding helper functions to enable,disable wake irqs to make > the code simple and readable. > > Signed-off-by: Sandeep Maheswaram > Reviewed-by: Matthias Kaehlcke > --- > drivers/usb/dwc3/dwc3-qcom.c | 58 ++++++++++++++++++++------------------------ > 1 file changed, 26 insertions(+), 32 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 6cba990..7352124 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -296,50 +296,44 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom) > icc_put(qcom->icc_path_apps); > } > > +static void dwc3_qcom_enable_wakeup_irq(int irq) > +{ > + if (!irq) > + return; > + > + enable_irq(irq); > + enable_irq_wake(irq); > +} > + > +static void dwc3_qcom_disable_wakeup_irq(int irq) > +{ > + if (!irq) > + return; > + > + disable_irq_wake(irq); > + disable_irq_nosync(irq); > +} > + > static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) > { > - if (qcom->hs_phy_irq) { > - disable_irq_wake(qcom->hs_phy_irq); > - disable_irq_nosync(qcom->hs_phy_irq); > - } > + dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); > > - if (qcom->dp_hs_phy_irq) { > - disable_irq_wake(qcom->dp_hs_phy_irq); > - disable_irq_nosync(qcom->dp_hs_phy_irq); > - } > + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); > > - if (qcom->dm_hs_phy_irq) { > - disable_irq_wake(qcom->dm_hs_phy_irq); > - disable_irq_nosync(qcom->dm_hs_phy_irq); > - } > + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); > > - if (qcom->ss_phy_irq) { > - disable_irq_wake(qcom->ss_phy_irq); > - disable_irq_nosync(qcom->ss_phy_irq); > - } > + dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq); > } > > static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) > { > - if (qcom->hs_phy_irq) { > - enable_irq(qcom->hs_phy_irq); > - enable_irq_wake(qcom->hs_phy_irq); > - } > + dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); > > - if (qcom->dp_hs_phy_irq) { > - enable_irq(qcom->dp_hs_phy_irq); > - enable_irq_wake(qcom->dp_hs_phy_irq); > - } > + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); > > - if (qcom->dm_hs_phy_irq) { > - enable_irq(qcom->dm_hs_phy_irq); > - enable_irq_wake(qcom->dm_hs_phy_irq); > - } > + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); > > - if (qcom->ss_phy_irq) { > - enable_irq(qcom->ss_phy_irq); > - enable_irq_wake(qcom->ss_phy_irq); > - } > + dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq); > } > > static int dwc3_qcom_suspend(struct dwc3_qcom *qcom) Looks good to me. Thanks, Pavan