From: Abel Vesa <abel.vesa@linaro.org>
To: Wenbin Yao <quic_wenbyao@quicinc.com>
Cc: vkoul@kernel.org, kishon@kernel.org, p.zabel@pengutronix.de,
dmitry.baryshkov@linaro.org, quic_qianyu@quicinc.com,
neil.armstrong@linaro.org, manivannan.sadhasivam@linaro.org,
quic_devipriy@quicinc.com, konrad.dybcio@oss.qualcomm.com,
linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] phy: qcom: pcie: Determine has_nocsr_reset dynamically
Date: Tue, 21 Jan 2025 11:55:13 +0200 [thread overview]
Message-ID: <Z49vAXdhROVm93TW@linaro.org> (raw)
In-Reply-To: <20250121094140.4006801-2-quic_wenbyao@quicinc.com>
On 25-01-21 17:41:39, Wenbin Yao wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Decide the in-driver logic based on whether the nocsr reset is present
> and defer checking the appropriateness of that to dt-bindings to save
> on boilerplate.
>
> Reset controller APIs are fine consuming a nullptr, so no additional
> checks are necessary there.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Wenbin Yao <quic_wenbyao@quicinc.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> index 873f2f9844c6..ac42e4b01065 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> @@ -2793,8 +2793,6 @@ struct qmp_phy_cfg {
>
> bool skip_start_delay;
>
> - bool has_nocsr_reset;
> -
> /* QMP PHY pipe clock interface rate */
> unsigned long pipe_clock_rate;
>
> @@ -3685,7 +3683,6 @@ static const struct qmp_phy_cfg sm8550_qmp_gen4x2_pciephy_cfg = {
>
> .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
> .phy_status = PHYSTATUS_4_20,
> - .has_nocsr_reset = true,
>
> /* 20MHz PHY AUX Clock */
> .aux_clock_rate = 20000000,
> @@ -3718,7 +3715,6 @@ static const struct qmp_phy_cfg sm8650_qmp_gen4x2_pciephy_cfg = {
>
> .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
> .phy_status = PHYSTATUS_4_20,
> - .has_nocsr_reset = true,
>
> /* 20MHz PHY AUX Clock */
> .aux_clock_rate = 20000000,
> @@ -3836,7 +3832,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x2_pciephy_cfg = {
>
> .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
> .phy_status = PHYSTATUS_4_20,
> - .has_nocsr_reset = true,
> };
>
> static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = {
> @@ -3870,7 +3865,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = {
>
> .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
> .phy_status = PHYSTATUS_4_20,
> - .has_nocsr_reset = true,
> };
>
> static const struct qmp_phy_cfg x1e80100_qmp_gen4x8_pciephy_cfg = {
> @@ -3902,7 +3896,6 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x8_pciephy_cfg = {
>
> .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
> .phy_status = PHYSTATUS_4_20,
> - .has_nocsr_reset = true,
> };
>
> static void qmp_pcie_init_port_b(struct qmp_pcie *qmp, const struct qmp_phy_cfg_tbls *tbls)
> @@ -4203,11 +4196,14 @@ static int qmp_pcie_reset_init(struct qmp_pcie *qmp)
> if (ret)
> return dev_err_probe(dev, ret, "failed to get resets\n");
>
> - if (cfg->has_nocsr_reset) {
> - qmp->nocsr_reset = devm_reset_control_get_exclusive(dev, "phy_nocsr");
> - if (IS_ERR(qmp->nocsr_reset))
> + qmp->nocsr_reset = devm_reset_control_get_exclusive(dev, "phy_nocsr");
> + if (IS_ERR(qmp->nocsr_reset)) {
> + if (PTR_ERR(qmp->nocsr_reset) == -ENOENT ||
> + PTR_ERR(qmp->nocsr_reset) == -EINVAL)
> + qmp->nocsr_reset = NULL;
> + else
> return dev_err_probe(dev, PTR_ERR(qmp->nocsr_reset),
> - "failed to get no-csr reset\n");
> + "failed to get no-csr reset\n");
> }
>
> return 0;
> --
> 2.34.1
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2025-01-21 9:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 9:41 [PATCH 0/2] phy: qcom: qmp-pcie: Add PCIe PHY no_csr reset support Wenbin Yao
2025-01-21 9:41 ` [PATCH 1/2] phy: qcom: pcie: Determine has_nocsr_reset dynamically Wenbin Yao
2025-01-21 9:55 ` Abel Vesa [this message]
2025-01-24 7:10 ` Manivannan Sadhasivam
2025-01-21 9:41 ` [PATCH 2/2] phy: qcom: qmp-pcie: Add PHY register retention support Wenbin Yao
2025-01-21 10:36 ` Dmitry Baryshkov
2025-01-22 7:17 ` Wenbin Yao (Consultant)
2025-01-22 9:43 ` Dmitry Baryshkov
2025-01-24 6:22 ` Qiang Yu
2025-01-24 7:08 ` Manivannan Sadhasivam
2025-01-25 13:10 ` Konrad Dybcio
2025-01-29 8:29 ` neil.armstrong
2025-01-29 11:29 ` Konrad Dybcio
2025-01-29 13:41 ` neil.armstrong
2025-01-29 13:55 ` Konrad Dybcio
2025-01-29 14:19 ` neil.armstrong
2025-02-08 2:24 ` Konrad Dybcio
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=Z49vAXdhROVm93TW@linaro.org \
--to=abel.vesa@linaro.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=kishon@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=quic_devipriy@quicinc.com \
--cc=quic_qianyu@quicinc.com \
--cc=quic_wenbyao@quicinc.com \
--cc=vkoul@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;
as well as URLs for NNTP newsgroup(s).