[PATCH v3 3/5] phy: qcom: qmp-pcie: Support multiple nocsr resets
Qiang Yu
qiang.yu at oss.qualcomm.com
Wed Apr 15 20:02:24 PDT 2026
On Mon, Apr 13, 2026 at 10:10:31AM +0200, Philipp Zabel wrote:
> On So, 2026-04-12 at 23:25 -0700, Qiang Yu wrote:
> > Refactor nocsr reset handling to support multiple nocsr resets required
> > for PHY configurations with bifurcated operation modes.
> >
> > The Glymur SoC's 3rd PCIe instance supports 8-lane mode using two PHYs
> > in bifurcation, where each PHY requires its own nocsr reset to be
> > controlled simultaneously. The current implementation only supports a
> > single nocsr reset per PHY configuration.
> >
> > Add num_nocsr and nocsr_list fields to struct qmp_phy_cfg to represent the
> > number and names of a group of nocsr reset names. Initialize these fields
> > for all PHYs that have nocsr resets, allowing the driver to correctly
> > acquire multiple nocsr resets during probe and control them as an array
> > by using reset_control_bulk APIs.
> >
> > The refactoring maintains backward compatibility for existing single
> > nocsr reset configurations while enabling support for multi-PHY
> > scenarios like Glymur's 8-lane bifurcation mode.
> >
> > Additionally, introduces x1e80100_qmp_gen3x2_pciephy_cfg as a separate
> > configuration from sm8550_qmp_gen3x2_pciephy_cfg since the x1e80100 Gen3x2
> > PHY requires nocsr reset support while the sm8550 Gen3x2 PHY does not.
> >
> > Signed-off-by: Qiang Yu <qiang.yu at oss.qualcomm.com>
> > ---
> > drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 87 ++++++++++++++++++++++++++++----
> > 1 file changed, 77 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> > index 424c935e27a8766e1e26762bd3d7df527c1520e3..51db9eea41255bad0034bbcfbfdc36894c2bc95f 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> [...]
> > @@ -4998,14 +5054,25 @@ static int qmp_pcie_reset_init(struct qmp_pcie *qmp)
> > for (i = 0; i < cfg->num_resets; i++)
> > qmp->resets[i].id = cfg->reset_list[i];
> >
> > - ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets);
> > + ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets,
> > + qmp->resets);
>
> Unrelated and unnecessary change.
Ohk, I changed it by mistake.
>
> > if (ret)
> > return dev_err_probe(dev, ret, "failed to get resets\n");
> >
> > - qmp->nocsr_reset = devm_reset_control_get_optional_exclusive(dev, "phy_nocsr");
> > - if (IS_ERR(qmp->nocsr_reset))
> > - return dev_err_probe(dev, PTR_ERR(qmp->nocsr_reset),
> > - "failed to get no-csr reset\n");
> > + if (!cfg->num_nocsr_resets)
> > + return 0;
> > + qmp->nocsr_reset = devm_kcalloc(dev, cfg->num_nocsr_resets,
> > + sizeof(*qmp->nocsr_reset), GFP_KERNEL);
> > + if (!qmp->nocsr_reset)
> > + return -ENOMEM;
> > +
> > + for (i = 0; i < cfg->num_nocsr_resets; i++)
> > + qmp->nocsr_reset[i].id = cfg->nocsr_reset_list[i];
> > +
> > + ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_nocsr_resets,
> > + qmp->nocsr_reset);
>
> Should this be devm_reset_control_bulk_get_optional_exclusive()?
>
I have get the num_nocsr_resets previously, so don't need to use
devm_reset_control_bulk_get_optional_exclusive.
- Qiang Yu
> regards
> Philipp
More information about the linux-phy
mailing list