Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10695459rwp; Fri, 21 Jul 2023 03:34:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlE5RcHC71V1TyzOzhuGiQjEj+s/5fXtjeOmkpOvKPN76rJUV7KtNoNZrkkhmyYOMsDIQgUD X-Received: by 2002:a05:6358:52d3:b0:138:3b4f:7b87 with SMTP id z19-20020a05635852d300b001383b4f7b87mr2176338rwz.8.1689935682431; Fri, 21 Jul 2023 03:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689935682; cv=none; d=google.com; s=arc-20160816; b=pPFKB6uqyRIfi5YZRs6wDbcvZNfs1wKd3twtCtJAdW+wYxtQ9/Qp08dGc3DXJ7l5Zm ooZgVgvhdkkm+zGH1iJKwBrlShVjkBPX7dRSXckG7dRbVcosj3+5wDKR+jp6uymCgVKh U08LiCYCbq2Q59J+0lVvnSdhmbGkdeaPkUXiHZASz7Q7t/d4qRV+ERJ6mEdIAcLkMi+A 6PFX2v99l3zL5UplMBKOLtbM5+F9itwJiJ0IqllfwuWbAjfVYILBrTsxWSZ33YmC0Pdz ZQJoUtcMm6NqJ8rp+3z1A9cw78WU53Z0Q4RbWhBkkm9xZ+E1g/fu2zvR7U/2PdxqKra1 LWuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hT/Hvkvkw2UyT6qEmcVlLXgM/BmaZd0oKyvjZLonQa4=; fh=UEO6DUCScS1XZa80QNcd/EiynXVLftfxxuw+qRxSntc=; b=p0s1MBPxJ5Qi9RGr8WCMKezRuqLiv5jpLkDHHnkohsQcKIGFgIAx6zQ5enLfEWfSeb rG1b0yvBBLq+WD1LdxJ312315jlExQ6P7UyTv02LiLpv9XHbpfk0z/8qqa9wyo8eoACt hqi/5CUDPVmvZfgBzV5SEbdOrREOJ1PKEnB/4sooIQ5SHrVc8lVQYL8pEiYVRYZ2COeW zgK0P8UOBZBbm3HF3CEMPHCD61xCF9CBOjd/XLu/vm2VyV6Xir4pFodUTMqD65LEDe1s Hymp4k24k+UBW9FiczDLBur1lmedHDCmL3nRqQF//7gW1ghXtnO9Aq8rPHd5uj/yHZVO FW4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=P8RYka+h; 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 w4-20020a656944000000b0055e67e3f0besi2603687pgq.566.2023.07.21.03.34.29; Fri, 21 Jul 2023 03:34:42 -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=qcppdkim1 header.b=P8RYka+h; 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 S231325AbjGUJgV (ORCPT + 99 others); Fri, 21 Jul 2023 05:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjGUJgS (ORCPT ); Fri, 21 Jul 2023 05:36:18 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7EE30EC; Fri, 21 Jul 2023 02:36:04 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36L67sqS004103; Fri, 21 Jul 2023 09:35:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=hT/Hvkvkw2UyT6qEmcVlLXgM/BmaZd0oKyvjZLonQa4=; b=P8RYka+hNHRKTLiGkw7IQJeFOoHCXsOAk1rfECNawsxF7ZhVzqK+Ii6GDmcfkkjOtjXG T565kR+TPn7qmBGIKstYY884d/HUw8enKy1tT5PHLVydp0BIO0PY6Q0h0po9L/C9zl2K bUuXqpYIRp7IdHxcrqCaLoV2+kU4oDMp9dcy4NcMA5hzdxrX6q2rTPQH75iQsQZ4/uS9 KNZbBc86jO7jd7YY9W1oNXhOjPkih67gh/T1qw9+s4kYB7ijAcSy43yvsx4lunul6rqi lMR7AbC9iWjq+yurCPSihMJOq/5d7arjfQKukltQspMxEKo4dJ42n1vNSpNpZqGZrd/w UQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rxpyqv2ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 09:35:48 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36L9ZkWa014502 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 09:35:46 GMT Received: from [10.216.63.95] (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.1118.30; Fri, 21 Jul 2023 02:35:40 -0700 Message-ID: <4b58fdfa-83a4-290b-f7e8-e82feba4586a@quicinc.com> Date: Fri, 21 Jul 2023 15:05:36 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 Subject: Re: [PATCH v9 06/10] usb: dwc3: qcom: Add support to read IRQ's related to multiport Content-Language: en-US To: Johan Hovold , Bjorn Andersson , Konrad Dybcio CC: Thinh Nguyen , Greg Kroah-Hartman , Philipp Zabel , "Andy Gross" , Rob Herring , "Krzysztof Kozlowski" , Felipe Balbi , Wesley Cheng , , , , , , , , , , References: <20230621043628.21485-1-quic_kriskura@quicinc.com> <20230621043628.21485-7-quic_kriskura@quicinc.com> <7e32cf95-1565-5736-cc3e-c70e8d8f3ca7@quicinc.com> From: Krishna Kurapati PSSNV In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 0C-ftZxKohf9FxNmafqt0CU_SvWSKlmB X-Proofpoint-ORIG-GUID: 0C-ftZxKohf9FxNmafqt0CU_SvWSKlmB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_06,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=418 malwarescore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 bulkscore=0 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307210084 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 7/21/2023 2:51 PM, Johan Hovold wrote: > Again, please remember to trim your replies. > > On Fri, Jul 21, 2023 at 01:49:37PM +0530, Krishna Kurapati PSSNV wrote: >> On 7/21/2023 1:44 PM, Johan Hovold wrote: >>> On Mon, Jul 03, 2023 at 12:29:41AM +0530, Krishna Kurapati PSSNV wrote: >>>> On 6/27/2023 8:01 PM, Johan Hovold wrote: > > [...] > >>>>> So the above should all be merged in either a single helper looking up >>>>> all the interrupts for a port and resused for the non-MP case. > >> How about the implementation in the attached patches. This way we >> don't need to know if we are multiport capable or not. > > As I wrote above, I think you should instead add a common helper for > setting up all the interrupts for a port. For example, along the lines > of: > > dwc3_setup_port_irq(int index) > { > if (index == 0) > try non-mp name > else > generate mp name > > lookup and request hs irqs > lookup and request ss irq > lookup and request power irq > } > > dwc3_setup_irq() > { > determine if MP (num_ports) > > for each port > dwc3_setup_port_irq(port index) > } > The port irq helper can either be told using a second argument that this > is a non-mp controller, or you can first try looking up one of the > non-mp names. > I think I did something similar. I prepared a helper to request IRQ in the patch and the main logic would reside in setup_irq where i would try and get IRQ's. Irrespective of whether we are MP capable or not, how about we read all IRQ's like in the patch attached previously. And the implementation facilitates addition of ACPI to multiport also if required. I am just trying to cover all cases like this by declaring IRQ info in global section. 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(/* Give inouts here*/); 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) { for (DP_IRQ[ i = 0-3] { try getting dp_irq_i using MP_IRQ strings if ((ret < 0) and (i == 0)) try getting dp_irq_i using NON_MP_IRQ strings call prep_irq accordingly. } //Run same loop for DM and SS } The second patch was just enabling IRQ's for all ports to support wakeup. > My mailer discarded your second patch, but you cannot assume that the > devices connected to each port are of the same type (e.g. HS or SS) > based on what is connected to the first port. > Are you referring to enabling IRQ's for different ports before going to suspend ? Meaning get the speed of enum on each port and accordingly enable IRQ's ? Regards, Krishna,