Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3243225lqp; Tue, 26 Mar 2024 04:02:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJFo3WEOcwk+5PYQGHc5SBM9Yx0bnaWbO/s1WFW40xkxzno2aVy6Qj52NQpYTv1elD8UlQxR/cNVh1fgEWdYpYL7LBo3jl+c4DaVCsIA== X-Google-Smtp-Source: AGHT+IG9rf11j5uXaVx46ymPXZfD3oEFlGfQ55oM1ZFI1BFYeDRS7U72lBzEVC93zIBmBsOAucg8 X-Received: by 2002:a17:903:987:b0:1e0:cd8a:58c with SMTP id mb7-20020a170903098700b001e0cd8a058cmr2617623plb.1.1711450949206; Tue, 26 Mar 2024 04:02:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711450949; cv=pass; d=google.com; s=arc-20160816; b=LgW7lVaM92GA9AgTPH5/0di7uXgSXlvkIwmM3Tawi4XYrFw4HiuRREIMFXQrPp0tZJ heWvyIL4CLqpqvyJHw7Pzf5U1hBQ28b3Rm3tFzV8v2f9Dc14piXOsnUPXn4c0+6C8cJ4 /hFpm984cIuN10FfUSAiZP7cOrLl6C7Qattwo/qFHwBp/wQuND6yq179Wy0VqvcybO3M yGnFV0YgjeXXgJ2hQPAC2gT9BW3p3QyKIKbiSexcUJXW80BJoypWWjDrTT2uP+A7ShSV Yzlf3CkbOeKBta5YQJFRV+rEz0F7UNKnA2KS8sMLCsjthoVsrKUyBi6X93shAmk5KHwT aiBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fE5AlmHyNvS5+SEnK8aL8WXfIUWGZNkS9OJL/MhX2YI=; fh=D3HPyjmOZxmqx38aLC19y80oSbLSCK2feam6cXMVhP0=; b=lIDvMWTygMxCAyjI+0JoW4zKuW51Yofa/ZJdfay2wn0aqxbsaEUR4x9hNL5rX9q4cL wlYiVkCXOHpAz3/gQkymu683OWpNh1EGywC38lx0nb25Yn04s2VFgInJiohLNfyH2q/I xmhrvFHgw33K1Yk0jHFALgCgxF0aB+k5I5julTvIf5wEHnT7bhoAZDlLlk2E6kx+a77F CjVJVayrzW/VxBTJIS0OrkFws80xA6eMjciCq9otjTcIrgxAqL1S9g0dXfwz/9HkBIKp u8RFjHJreBbM0ciX7sxt5ymmizfswDQvfXBx5ucna7FsnbT+DvMfFRQPRYsy2MeFEM2x Ifvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nfuy0lN/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e7-20020a17090301c700b001dfcea2b477si7415128plh.59.2024.03.26.04.02.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nfuy0lN/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118824-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DA1A5B23CF9 for ; Tue, 26 Mar 2024 10:44:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C842DCA62; Tue, 26 Mar 2024 10:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nfuy0lN/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEB3629A0; Tue, 26 Mar 2024 10:43:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711449837; cv=none; b=hElQiJnLtf5m0tSObpbP8q7/0W4X8MEf7qcJAFQUW+bOH4GMonLSisBFGEyDEevNBYKs2j3K4vMq+1IjVq/dahCU6sPfbaFKZkeJMnB2UEoTplWxs45eYVxv5P4KM5B/cafs+Bjz8bCAd2XJlDZp89kyggJkay2/567mCkDdkC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711449837; c=relaxed/simple; bh=vwyF+iRB3lA+0ZCjAOIqFFU72W87k8/58YHoJa8WpLw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HlcWIUdl8TTxxrBA+DM1rv/N9HovJUE9YBGsq/iDWXmkZqrlrRlyPYk+qY08bEm3R+tGEuTWva9uN+3N4rHWnjQkHClL9vbh64LtG0PDzGxeTHzg7QiCS7pO9NQg9ScXBakB87Rk2SAPUjnznwItqiqSUrRU00tx5cycbvNgdog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nfuy0lN/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66389C433C7; Tue, 26 Mar 2024 10:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711449836; bh=vwyF+iRB3lA+0ZCjAOIqFFU72W87k8/58YHoJa8WpLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nfuy0lN/KkDKyqzc/6Jezrot7iUFD9NrHKfw8jx5XhqWYXw4VTEgWxdF8ZsikQrfG 90McEfcuNo4rsreuwIZZI7U5HkFMULmFC/hM4VAuYElGq5C4xiXGnXzwfN+TON4H6V nwWWJD6dzlo6+eob9+tLpY9kngamg1oT322hcGqHVdeKEpx+OTyBjdJDB8g+MnF31L xawQ5PDCIHt4xgFxu1PQewr/PTUgmYk79IHOwCBkw2HElDS3Eod8msriyEEZCw/7Rc 66x8oMX/NVKqNFewcYObhvp/UfVNZZmWyQgUq0huGHEhDhMlgEzl7t82KXmyEfxwwz KEhKlBv+uVfHQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rp4Hj-000000007jO-0ymj; Tue, 26 Mar 2024 11:44:03 +0100 Date: Tue, 26 Mar 2024 11:44:03 +0100 From: Johan Hovold To: Krishna Kurapati Cc: Krzysztof Kozlowski , Rob Herring , Bjorn Andersson , Wesley Cheng , Konrad Dybcio , Greg Kroah-Hartman , Conor Dooley , Thinh Nguyen , Felipe Balbi , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, quic_ppratap@quicinc.com, quic_jackp@quicinc.com, Johan Hovold Subject: Re: [PATCH v17 7/9] usb: dwc3: qcom: Refactor IRQ handling in glue driver Message-ID: References: <20240326102809.2940123-1-quic_kriskura@quicinc.com> <20240326102809.2940123-8-quic_kriskura@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240326102809.2940123-8-quic_kriskura@quicinc.com> On Tue, Mar 26, 2024 at 03:58:07PM +0530, Krishna Kurapati wrote: > On multiport supported controllers, each port has its own DP/DM > and SS (if super speed capable) interrupts. As per the bindings, > their interrupt names differ from standard ones having "_x" added > as suffix (x indicates port number). Identify from the interrupt > names whether the controller is a multiport controller or not. > Refactor dwc3_qcom_setup_irq() call to parse multiport interrupts > along with non-multiport ones accordingly.. > > Signed-off-by: Krishna Kurapati > Reviewed-by: Johan Hovold > --- > drivers/usb/dwc3/dwc3-qcom.c | 137 ++++++++++++++++++++++++++--------- > 1 file changed, 103 insertions(+), 34 deletions(-) > -static int dwc3_qcom_setup_irq(struct platform_device *pdev) > +static int dwc3_qcom_setup_port_irq(struct platform_device *pdev, int port_num, bool is_multiport) Here you use "port_num", when it's really a (zero-based) port index. Please change to "port_index". > { > struct dwc3_qcom *qcom = platform_get_drvdata(pdev); > + const char *irq_name; > int irq; > int ret; > > - irq = platform_get_irq_byname_optional(pdev, "qusb2_phy"); > + if (is_multiport) > + irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "dp_hs_phy_%d", port_num + 1); > + else > + irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "dp_hs_phy_irq"); > + if (!irq_name) > + return -ENOMEM; > +static int dwc3_qcom_find_num_ports(struct platform_device *pdev) > +{ > + char irq_name[14]; > + int port_index; > + int irq; > + > + irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1"); > + if (irq <= 0) > + return 1; > + > + for (port_index = 2; port_index <= DWC3_MAX_PORTS; port_index++) { And here you use port_index, when it's really a one-based port number. I explicitly used "port" when we discussed the update here for this reason ("port_num" works too). Please fix this last thing in a v18 and we're good to go. > + sprintf(irq_name, "dp_hs_phy_%d", port_index); > + > + irq = platform_get_irq_byname_optional(pdev, irq_name); > + if (irq <= 0) > + return port_index - 1; > + } > + > + return DWC3_MAX_PORTS; > +} Johan