From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krishna Kurapati <quic_kriskura@quicinc.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Conor Dooley <conor+dt@kernel.org>,
Johan Hovold <johan@kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"quic_ppratap@quicinc.com" <quic_ppratap@quicinc.com>,
"quic_jackp@quicinc.com" <quic_jackp@quicinc.com>
Subject: Re: [PATCH v5 2/2] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
Date: Fri, 22 Dec 2023 22:14:02 +0000 [thread overview]
Message-ID: <20231222221401.ftvrkwlxdbe7zxkz@synopsys.com> (raw)
In-Reply-To: <20231222063648.11193-3-quic_kriskura@quicinc.com>
On Fri, Dec 22, 2023, Krishna Kurapati wrote:
> For wakeup to work, driver needs to enable interrupts that depict what is
> happening on the DP/DM lines. On QUSB targets, this is identified by
> qusb2_phy whereas on SoCs using Femto PHY, separate {dp,dm}_hs_phy_irq's
> are used instead.
>
> The implementation incorrectly names qusb2_phy interrupts as "hs_phy_irq".
> Clean this up so that driver would be using only qusb2/(dp & dm) for wakeup
> purposes.
>
> For devices running older kernels, this won't break any functionality
> because the interrupt configurations in QUSB2 PHY based SoCs is done
> by configuring QUSB2PHY_INTR_CTRL register in PHY address space and it was
> never armed properly right from the start.
>
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
> ---
> drivers/usb/dwc3/dwc3-qcom.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index fdf6d5d3c2ad..dbd6a5b2b289 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -57,7 +57,7 @@ struct dwc3_acpi_pdata {
> u32 qscratch_base_offset;
> u32 qscratch_base_size;
> u32 dwc3_core_base_size;
> - int hs_phy_irq_index;
> + int qusb2_phy_irq_index;
> int dp_hs_phy_irq_index;
> int dm_hs_phy_irq_index;
> int ss_phy_irq_index;
> @@ -73,7 +73,7 @@ struct dwc3_qcom {
> int num_clocks;
> struct reset_control *resets;
>
> - int hs_phy_irq;
> + int qusb2_phy_irq;
> int dp_hs_phy_irq;
> int dm_hs_phy_irq;
> int ss_phy_irq;
> @@ -372,7 +372,7 @@ static void dwc3_qcom_disable_wakeup_irq(int irq)
>
> static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
> {
> - dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq);
> + dwc3_qcom_disable_wakeup_irq(qcom->qusb2_phy_irq);
>
> if (qcom->usb2_speed == USB_SPEED_LOW) {
> dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq);
> @@ -389,7 +389,7 @@ static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
>
> static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
> {
> - dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq, 0);
> + dwc3_qcom_enable_wakeup_irq(qcom->qusb2_phy_irq, 0);
>
> /*
> * Configure DP/DM line interrupts based on the USB2 device attached to
> @@ -542,19 +542,19 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
> int irq;
> int ret;
>
> - irq = dwc3_qcom_get_irq(pdev, "hs_phy_irq",
> - pdata ? pdata->hs_phy_irq_index : -1);
> + irq = dwc3_qcom_get_irq(pdev, "qusb2_phy",
> + pdata ? pdata->qusb2_phy_irq_index : -1);
> if (irq > 0) {
> /* Keep wakeup interrupts disabled until suspend */
> ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
> qcom_dwc3_resume_irq,
> IRQF_ONESHOT | IRQF_NO_AUTOEN,
> - "qcom_dwc3 HS", qcom);
> + "qcom_dwc3 QUSB2", qcom);
> if (ret) {
> - dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret);
> + dev_err(qcom->dev, "qusb2_phy_irq failed: %d\n", ret);
> return ret;
> }
> - qcom->hs_phy_irq = irq;
> + qcom->qusb2_phy_irq = irq;
> }
>
> irq = dwc3_qcom_get_irq(pdev, "dp_hs_phy_irq",
> @@ -1058,7 +1058,7 @@ static const struct dwc3_acpi_pdata sdm845_acpi_pdata = {
> .qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET,
> .qscratch_base_size = SDM845_QSCRATCH_SIZE,
> .dwc3_core_base_size = SDM845_DWC3_CORE_SIZE,
> - .hs_phy_irq_index = 1,
> + .qusb2_phy_irq_index = 1,
> .dp_hs_phy_irq_index = 4,
> .dm_hs_phy_irq_index = 3,
> .ss_phy_irq_index = 2
> @@ -1068,7 +1068,7 @@ static const struct dwc3_acpi_pdata sdm845_acpi_urs_pdata = {
> .qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET,
> .qscratch_base_size = SDM845_QSCRATCH_SIZE,
> .dwc3_core_base_size = SDM845_DWC3_CORE_SIZE,
> - .hs_phy_irq_index = 1,
> + .qusb2_phy_irq_index = 1,
> .dp_hs_phy_irq_index = 4,
> .dm_hs_phy_irq_index = 3,
> .ss_phy_irq_index = 2,
> --
> 2.42.0
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thanks,
Thinh
prev parent reply other threads:[~2023-12-22 22:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 6:36 [PATCH v5 0/2] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
2023-12-22 6:36 ` [PATCH v5 1/2] dt-bindings: usb: dwc3: Clean up hs_phy_irq in binding Krishna Kurapati
2023-12-25 13:05 ` Krzysztof Kozlowski
2023-12-26 5:37 ` Krishna Kurapati PSSNV
2023-12-26 9:33 ` Krzysztof Kozlowski
2023-12-26 10:03 ` Krishna Kurapati PSSNV
2023-12-26 12:22 ` Krzysztof Kozlowski
2023-12-26 15:03 ` Krishna Kurapati PSSNV
2023-12-26 19:04 ` Krzysztof Kozlowski
2023-12-27 2:18 ` Krishna Kurapati PSSNV
2024-01-03 14:52 ` Krishna Kurapati PSSNV
2023-12-22 6:36 ` [PATCH v5 2/2] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq Krishna Kurapati
2023-12-22 22:14 ` Thinh Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231222221401.ftvrkwlxdbe7zxkz@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_jackp@quicinc.com \
--cc=quic_kriskura@quicinc.com \
--cc=quic_ppratap@quicinc.com \
--cc=quic_wcheng@quicinc.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox