Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2951993ioo; Tue, 24 May 2022 09:31:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6srirUWLcxmClRUiIvlO89DNM717FQpGf39mHVyHeANqiCSAK+1PSKJK8EHY4AoEYpIf0 X-Received: by 2002:a17:906:3958:b0:6fe:90ef:c4b with SMTP id g24-20020a170906395800b006fe90ef0c4bmr25619414eje.36.1653409878929; Tue, 24 May 2022 09:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653409878; cv=none; d=google.com; s=arc-20160816; b=g46HbmQCeA90BAzLB6WnJuG6shw1Fm2CvnqJdlSa5CSeP1AXoMrUE1Dy/y2PwQDO3y qrRVndiIB7d70HJCyOhfgISb1m/GcBDSI/p4tKcpMTYDc4EauTFna9CZLdbIMs4WiL12 3avVfWa4EJITmPI+qnBICYoQ3Ta2nRd8LptRe2iMGeaxlj5TIEk3dzwwyZLRoX+DFf7J 1l+3/iJw1vjlI7KlQXVwCfa44wBoepTnXu+BeYU4Df7pBgxopA/WuHoXK+WOQRYZgYIz Vs5evh+CjvELmHyDkQ/0uPxYtEctAerJVok8caqs6iFoMCs9TtzjYTNvYScSacOKXxR+ xdVg== 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=JqeZjIB028ykAmVB9cb3qEY7RZDjhMO1Vu+kkmPNrRg=; b=bTyWRbp46u4XrBawB86XA3XBsQ4mMqq/cIHQe3u2uFSwrxXc3MtDNXX2+HRsRxka1C OSHu3JAmVYvlhPNjub/4OBRyf6emnUpRv4BzaQpqWtJAPvk57rWA6S4VniY/tExBqhil BFzlpo5i8+HDE5zZmWKCIT7aeVPua8YHdDz/07I/EykK/TZ6VEKW7JrcFOMwo1VrYkTQ eY/KwQKhKBjF+Y7M1IZ3+j3InDOxdkPJkeXCCjRFKnqFn8b3pU9Bt0KpFm2fhDJz5EXR FSMacrY2OBicUenrTKVrMXLsvPdMNt/XyAXOUT1ZIsN8pdvh0AVPlmWBQtKloi6v0uDm xtig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vGZ8JMVb; 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 y21-20020aa7c255000000b004289e7be14esi17385461edo.105.2022.05.24.09.30.51; Tue, 24 May 2022 09:31:18 -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=vGZ8JMVb; 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 S236210AbiEXKct (ORCPT + 99 others); Tue, 24 May 2022 06:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234520AbiEXKcr (ORCPT ); Tue, 24 May 2022 06:32:47 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C812262BE5; Tue, 24 May 2022 03:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653388362; x=1684924362; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JqeZjIB028ykAmVB9cb3qEY7RZDjhMO1Vu+kkmPNrRg=; b=vGZ8JMVb1XW5D5ZbGrd0Dl2dEoPEhExgYTWvKOUEmfJWk4HhO0zvyYZg iZgzeRaDkQZQ0IiVeYsiP/T2kwpCSMWjUJAYT9LWcA1vQGFgZMOnIB15T Awj/jEdlaB+0a9GiUVODM1OHO6CixYwTrmc1EpMXzTLIklE5CMmKGuSGm U=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 24 May 2022 03:32:42 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 03:32:42 -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, 24 May 2022 03:32:40 -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, 24 May 2022 03:32:35 -0700 Date: Tue, 24 May 2022 16:02:31 +0530 From: Pavan Kondeti To: Krishna Kurapati CC: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , , , , , , , , , Sandeep Maheswaram Subject: Re: [PATCH v17 3/5] usb: dwc3: qcom: Add helper functions to enable,disable wake irqs Message-ID: <20220524103231.GK15121@hu-pkondeti-hyd.qualcomm.com> References: <1653387228-28110-1-git-send-email-quic_kriskura@quicinc.com> <1653387228-28110-4-git-send-email-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1653387228-28110-4-git-send-email-quic_kriskura@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, May 24, 2022 at 03:43:46PM +0530, Krishna Kurapati wrote: > From: Sandeep Maheswaram > > Adding helper functions to enable,disable wake irqs to make > the code simple and readable. > > Signed-off-by: Sandeep Maheswaram > Reviewed-by: Matthias Kaehlcke > Signed-off-by: Krishna Kurapati > --- > 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) > -- > 2.7.4 > Looks good to me. Feel free to add Reviewed-by: Pavankumar Kondeti Thanks, Pavan