Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3749368rdh; Fri, 29 Sep 2023 00:52:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrzgNwyThVeqy04+lBDVz8GNGT9pDqpuieSQaVsLat+8DT0KvLgFFdKQWk+ZEv827uQ/YG X-Received: by 2002:a05:6870:d611:b0:1d4:cb38:f19e with SMTP id a17-20020a056870d61100b001d4cb38f19emr3989915oaq.9.1695973954332; Fri, 29 Sep 2023 00:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695973954; cv=none; d=google.com; s=arc-20160816; b=T/pIOH3qYcsPNFAAMXpsln+dHR/HdOWd74mkFnjD3WPZUntQlVEZOtr5TNtx7trJSq oqOm9LTDOIU4oJT2/FyV/0TFKZrkwOFVt+JG+U68gBp/9DcxvhRnUSqNJw7A/6kfzuun ZPCSAsz+aMi4SexaQjOVWZsl2wEl+60peb4DkzuTtbT9E0u5kJG2fZRBd4b+PZIOd4jW 28TGfsdnO4M+6qhFquKOU+6Nwu6yftkcgDYxXyfxi44OIP8e9HoEyTj79cQxCw0Y6l+J SOKHgpig+Z9KBlVcW5v2EzDHZ3iNAUPJ0Wa+5ZA2l1nikkVIJyEutr1ZR/9e8LGMjG06 t2hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vgmNGeMBAhmijdPijzuJfCS+lyPil3fUYE/6JzEm1OE=; fh=BAZ1NdxhWm8eNMul4Mw8oQkReiTpO/F5JLUxcfm98XU=; b=YiMRYIP5Dhl821oPC2phAsPaNZSBlFZlNLCplJZe//8GPxW0OMD6wSA7gZHxWUPCSP 2qS6JMldUgykH5ZptdC5fKt6YzLcpx9nDpiQiodfXkRFpJYZdNwUvct7bmTUaWZzQDEh ZtgUSYYcqoAOoo5PkUEeEwRmvJSq2488/1bVrj45D1ZWvyxHZ3H/IkldOtqjKvNV82kK BKiLYyLiHcpGSg5UaJAR7cr1RgH3KezJeZTTrCsSbHABgPk8jQXxLkvm40gR7yUhwary Dhyj/ws10wIe73ykOuOhbP7qrwEhCAjfRMxu6ZAhvESijd0XTW+iG++b6Mtjkrmjy6r3 qVCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RBWqyxvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p33-20020a056a0026e100b00690d79bafd9si18792746pfw.168.2023.09.29.00.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 00:52:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RBWqyxvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C8ECD8241E3C; Thu, 28 Sep 2023 14:49:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232521AbjI1Vsz (ORCPT + 99 others); Thu, 28 Sep 2023 17:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbjI1Vsy (ORCPT ); Thu, 28 Sep 2023 17:48:54 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E89DD19E; Thu, 28 Sep 2023 14:48:51 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SLZGch006680; Thu, 28 Sep 2023 21:48:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=vgmNGeMBAhmijdPijzuJfCS+lyPil3fUYE/6JzEm1OE=; b=RBWqyxviVo2hgov/1CrQXs32MwD697eLH691isCQYMYIIqh0OI7BzapEAmP1LBqPTQ1Z PIuvuiGuWXCQyG1BRkVpOj4i6cbfFjMCvk8rj0rd4Hd6YXxpkHQZHy1iClBbpTHcx9iX 9P//1htww4YEjC9GVJ4Zbpkdwy3l6L1OvdPpzxE8ggeRLWAI0Ux8yWuyGuErRf6NvZo/ 8QET3p4qeReua0asFeldNzMxz7A9s7C1KrPleh1KMwsFygkZ07+RwQtqm7tDrwjhrXFe poPESRnPmKM66jpv52nEh0i8eq7bv+JhAWh0XKzVS54mlholIxJw4sNJW+KiApXRa6uO Qg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3td8wdsaqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 21:48:29 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38SLmTgP017298 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 21:48:29 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 28 Sep 2023 14:48:28 -0700 Date: Thu, 28 Sep 2023 14:48:27 -0700 From: Bjorn Andersson To: Krishna Kurapati CC: Thinh Nguyen , Greg Kroah-Hartman , Philipp Zabel , "Andy Gross" , Bjorn Andersson , "Konrad Dybcio" , Rob Herring , Krzysztof Kozlowski , Felipe Balbi , Wesley Cheng , Johan Hovold , Mathias Nyman , , , , , , , , , Subject: Re: [PATCH v11 07/13] usb: dwc3: qcom: Add helper function to request threaded IRQ Message-ID: <20230928214827.GC3553829@hu-bjorande-lv.qualcomm.com> References: <20230828133033.11988-1-quic_kriskura@quicinc.com> <20230828133033.11988-8-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230828133033.11988-8-quic_kriskura@quicinc.com> X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: kbYv7G0Yxy3LsaaSpltaOdOq-DQ8SDl0 X-Proofpoint-GUID: kbYv7G0Yxy3LsaaSpltaOdOq-DQ8SDl0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-28_21,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=636 malwarescore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 mlxscore=0 clxscore=1011 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280186 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 14:49:18 -0700 (PDT) On Mon, Aug 28, 2023 at 07:00:27PM +0530, Krishna Kurapati wrote: > Cleanup setup irq call by implementing a new prep_irq helper function > and using it to request threaded IRQ's. > > Signed-off-by: Krishna Kurapati > --- > drivers/usb/dwc3/dwc3-qcom.c | 63 +++++++++++++++++------------------- > 1 file changed, 30 insertions(+), 33 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 3de43df6bbe8..f14ddc9c541d 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -535,6 +535,24 @@ static int dwc3_qcom_get_irq(struct platform_device *pdev, > return ret; > } > > +static int dwc3_qcom_prep_irq(struct dwc3_qcom *qcom, char *irq_name, > + char *disp_name, int irq) > +{ > + int ret; > + > + /* Keep wakeup interrupts disabled until suspend */ > + irq_set_status_flags(irq, IRQ_NOAUTOEN); > + ret = devm_request_threaded_irq(qcom->dev, irq, NULL, > + qcom_dwc3_resume_irq, > + IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > + disp_name, qcom); > + > + if (ret) > + dev_err(qcom->dev, "%s failed: %d\n", irq_name, ret); > + > + return ret; > +} > + > static int dwc3_qcom_setup_irq(struct platform_device *pdev) > { > struct dwc3_qcom *qcom = platform_get_drvdata(pdev); > @@ -545,61 +563,40 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev) > irq = dwc3_qcom_get_irq(pdev, "hs_phy_irq", > pdata ? pdata->hs_phy_irq_index : -1); > if (irq > 0) { > - /* Keep wakeup interrupts disabled until suspend */ > - irq_set_status_flags(irq, IRQ_NOAUTOEN); > - ret = devm_request_threaded_irq(qcom->dev, irq, NULL, > - qcom_dwc3_resume_irq, > - IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > - "qcom_dwc3 HS", qcom); > - if (ret) { > - dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret); > + ret = dwc3_qcom_prep_irq(qcom, "hs_phy_irq", > + "qcom_dwc3 HS", irq); Please leave these lines unwrapped. Nice cleanup. Reviewed-by: Bjorn Andersson Regards, Bjorn