Re: [PATCH v1 6/8] phy: qcom-qmp: Utilize UFS reset controller

Evan Green
2019-01-22T22:42:12Z

On Fri, Jan 18, 2019 at 2:33 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Evan Green (2019-01-11 15:01:27)
> > @@ -1214,6 +1225,32 @@ static int qcom_qmp_phy_init(struct phy *phy)
> >
> > dev_vdbg(qmp->dev, "Initializing QMP phy\n");
> >
> > + if (cfg->has_ufsphy_reset) {
> > + /*
> > + * Get UFS reset, which is delayed until now to avoid a
> > + * circular dependency where UFS needs its PHY, but the PHY
> > + * needs this UFS reset.
> > + */
> > + if (!qmp->ufs_reset) {
> > + qmp->ufs_reset = of_reset_control_get(qmp->dev->of_node,
>
> Can you use devm_reset_control_get()? Put another way, why is this DT
> specific instead of using a firmware/platform agnostic API?

Sure, will fix. (Though sadly of_* is peppered all over the place in
this file for lane resets, pipe clocks, and more).

>
> > + "ufsphy");
> > +
> > + if (IS_ERR(qmp->ufs_reset)) {
> > + dev_err(qmp->dev,
> > + "failed to get UFS reset: %d\n",
> > + PTR_ERR(qmp->ufs_reset));
> > +
> > + return PTR_ERR(qmp->ufs_reset);
> > + }
> > + }
> > +
> > + ret = reset_control_assert(qmp->ufs_reset);
> > + if (ret) {
> > + dev_err(qmp->dev, "ufsphy reset deassert failed\n");
>
> It's an assert though. Maybe just ignore the error message because the
> user won't be able to do anything anyway?
>

Fair enough. I'll remove the print from here and the deassert later.
-Evan