Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp234856rwp; Wed, 12 Jul 2023 12:24:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlGygnwIiwTdWQO6mwZZV/3Q9lWdWRIK86ixzzvwwxHVNu3OcRN/rrPJAKRQ89pcUgANu/Hn X-Received: by 2002:a17:903:234f:b0:1b6:4bbd:c3b6 with SMTP id c15-20020a170903234f00b001b64bbdc3b6mr18316161plh.9.1689189884659; Wed, 12 Jul 2023 12:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689189884; cv=none; d=google.com; s=arc-20160816; b=pCYnvmO1hn+JmQNJu/a53uff0DiqQ6otnAnh1+1HEAPV8CHFCIOK+EAypj1Z966+dH wP7celt07QFMfWvy0mCytUkGLCg5ykVwBhDTsLC9ogxPALVkU2bi5eOMorn0EwmVlyCm yEm/+zaoXFD55bhPlQWZ90/x8wrtkri8wBsuiBW0wv0MNbXoWm6q+OLaD6y5PbqlTI8Z 3uUQUxNBj2c+G9cmOicj8ARUnrcchoSY7iCdmi4iar1hDcFxUy/Kzn/ho8OIC72cDaSX f7c88Y3E1Lw3q6xKiOhW2P0MTxlzwx/FcdWCdnwT5Of9x87klLspgWu/qhCoH5yzp8xU 4oQQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mtKhEYS2K6X6LBtwPqDWhL1CJqJw4DS1omIajDx5ciM=; fh=PR8HtnyOm5t/MtcGclijb4mUnLMe+1Wl4/tuxXKbO7Y=; b=YOxFzU3qvGKMgyx2T+hjsEldom39eJOVSMc0l1prfNbSsqLYJ6S+TUrhZ+cOvfJvhm WJv/EolrhLy2T+hhcTcMETIJ5syZq11sE/oCfJ2OqiszuvGIzxyuLX9QM+d5oryUabbK j67QYbyCr01YPub/1S+UQb4tj3BKAaIp3UWqUrRsYyEYFLhCIkozeAWpmZYeUTOEzaa9 3o0XdKX2TaXRYK5w7FCP/BkDORHHlV4b4Ohex4jWLu5JNKqJeX+Sc7Vikb0ipbJ8QMju u+iVFyuqeT5IcwOx7iPad0Us4PjF1pmbI7qjko7vHj08IIoIXR72S2zBUA2ZSDc+LkQ3 3ghw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kdsNgjdU; 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 kw3-20020a170902f90300b001b8a591d5b9si3761856plb.133.2023.07.12.12.24.30; Wed, 12 Jul 2023 12:24:44 -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=kdsNgjdU; 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 S232557AbjGLS07 (ORCPT + 99 others); Wed, 12 Jul 2023 14:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232720AbjGLS04 (ORCPT ); Wed, 12 Jul 2023 14:26:56 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38651BEC; Wed, 12 Jul 2023 11:26:54 -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 36C8e7FA025489; Wed, 12 Jul 2023 18:26:44 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=mtKhEYS2K6X6LBtwPqDWhL1CJqJw4DS1omIajDx5ciM=; b=kdsNgjdUBhmwZnk+aZt4Ujk/GPBTCK1JSvcGs1qbfEfG0k0C5DFS5aahFTePkp85q7XF eM8DdXm1z5VYNHudXdnuG1qObW5tUHywSN61sDIx3uzwlwhfaagtq6237jDS9MnvkTU5 dNaTjeqRJoWHDi+azMc2b9hQbhcOYpp0ukEt6oK0AJoqf+DuKhsbvBhgbBtUrT84/+Jp RgBm1OaYv+aOmnpZrP8wH3p2KBKqBINUJ/92aL7G6rbNNgdYgP0hsR4gA8QLj9Njf1KJ BXkt0SAS1hLgfJRfdwbZQiH5pgLishusnE1BFn9ZtD9EUS36cId4phJusmLDc1RBb5Dz oQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rser0tce9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jul 2023 18:26:44 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36CIQhJt019354 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jul 2023 18:26:43 GMT Received: from [10.216.46.65] (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; Wed, 12 Jul 2023 11:26:36 -0700 Message-ID: Date: Wed, 12 Jul 2023 23:56:33 +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 To: Johan Hovold , Bjorn Andersson CC: Thinh Nguyen , Greg Kroah-Hartman , Philipp Zabel , "Andy Gross" , Konrad Dybcio , "Rob Herring" , Krzysztof Kozlowski , Felipe Balbi , "Wesley Cheng" , , , , , , , , , , References: <20230621043628.21485-1-quic_kriskura@quicinc.com> <20230621043628.21485-7-quic_kriskura@quicinc.com> Content-Language: en-US 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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: ZqQVfb4cm-Gui-6o8lMtobbyBRypXh4P X-Proofpoint-ORIG-GUID: ZqQVfb4cm-Gui-6o8lMtobbyBRypXh4P 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-12_13,2023-07-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=618 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307120167 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/12/2023 5:42 PM, Johan Hovold wrote: > On Wed, Jun 21, 2023 at 10:06:24AM +0530, Krishna Kurapati wrote: >> Add support to read Multiport IRQ's related to quad port controller >> of SA8295 Device. >> >> Signed-off-by: Krishna Kurapati >> --- >> drivers/usb/dwc3/dwc3-qcom.c | 108 +++++++++++++++++++++++++++++------ >> 1 file changed, 91 insertions(+), 17 deletions(-) > >> +static int dwc3_qcom_setup_mp_irq(struct platform_device *pdev) >> +{ >> + struct dwc3_qcom *qcom = platform_get_drvdata(pdev); >> + char irq_name[15]; > > The interrupt device-name string can not be allocated on the stack or > reused as it is stored directly in each irqaction structure. > > This can otherwise lead to random crashes when accessing > /proc/interrupts: > > https://lore.kernel.org/lkml/ZK6IV_jJPICX5r53@hovoldconsulting.com/ > Hi Johan, Sure, will create a static array of names if possible in global section of file and use it to read interrupts. Are you fine with seperating out setup_irq and setup_mp_irq functions ? Can you please review comments and suggestion on [1]. [1]: https://lore.kernel.org/all/bf62bdf4-cc9e-ba7b-2078-cfd60f5dd237@quicinc.com/ Regards, Krishna, >> + int irq; >> + int ret; >> + int i; >> + >> + for (i = 0; i < 4; i++) { >> + if (qcom->dp_hs_phy_irq[i]) >> + continue; >> + >> + sprintf(irq_name, "dp%d_hs_phy_irq", i+1); >> + irq = dwc3_qcom_get_irq(pdev, irq_name, -1); >> + if (irq > 0) { >> + 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, >> + irq_name, qcom); >> + if (ret) { >> + dev_err(qcom->dev, "%s failed: %d\n", irq_name, ret); >> + return ret; >> + } >> + } >> + >> + qcom->dp_hs_phy_irq[i] = irq; >> + } > > Johan