lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 22 Jan 2019 14:44:53 -0800
From:   Evan Green <evgreen@...omium.org>
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     Andy Gross <andy.gross@...aro.org>,
        Kishon Vijay Abraham I <kishon@...com>,
        Rob Herring <robh+dt@...nel.org>,
        Can Guo <cang@...eaurora.org>,
        Douglas Anderson <dianders@...omium.org>,
        Asutosh Das <asutoshd@...eaurora.org>,
        Vivek Gautam <vivek.gautam@...eaurora.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Arnd Bergmann <arnd@...db.de>,
        Grygorii Strashko <grygorii.strashko@...com>,
        LKML <linux-kernel@...r.kernel.org>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH v1 8/8] phy: qcom-ufs: Refactor all init steps into phy_poweron

On Fri, Jan 18, 2019 at 3:50 PM Stephen Boyd <swboyd@...omium.org> wrote:
>
> Quoting Evan Green (2019-01-11 15:01:29)
> > diff --git a/drivers/phy/qualcomm/phy-qcom-ufs.c b/drivers/phy/qualcomm/phy-qcom-ufs.c
> > index f2979ccad00a3..a4cff17fef925 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-ufs.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-ufs.c
> > @@ -147,6 +147,21 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
> >  }
> >  EXPORT_SYMBOL_GPL(ufs_qcom_phy_generic_probe);
> >
> > +static int ufs_qcom_phy_get_reset(struct ufs_qcom_phy *phy_common)
> > +{
> > +       struct reset_control *reset;
> > +
> > +       if (phy_common->ufs_reset)
> > +               return 0;
> > +
> > +       reset = of_reset_control_get_by_index(phy_common->dev->of_node, 0);
>
> Same question about using non-DT specific APIs to get the reset control
> here.

Will fix.

>
> > +       if (IS_ERR(reset))
> > +               return PTR_ERR(reset);
> > +
> > +       phy_common->ufs_reset = reset;
> > +       return 0;
> > +}
> > +
> >  static int __ufs_qcom_phy_clk_get(struct device *dev,
> >                          const char *name, struct clk **clk_out, bool err_print)
> >  {
> > @@ -528,23 +543,42 @@ int ufs_qcom_phy_power_on(struct phy *generic_phy)
> >  {
> >         struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy);
> >         struct device *dev = phy_common->dev;
> > +       bool is_rate_B = false;
> >         int err;
> >
> > -       if (phy_common->is_powered_on)
> > -               return 0;
> > +       err = ufs_qcom_phy_get_reset(phy_common);
> > +       if (err)
> > +               return err;
> >
> > -       if (!phy_common->is_started) {
> > -               err = ufs_qcom_phy_start_serdes(phy_common);
> > +       if (phy_common->ufs_reset) {
> > +               err = reset_control_assert(phy_common->ufs_reset);
> >                 if (err)
> >                         return err;
> > +       }
> >
> > -               err = ufs_qcom_phy_is_pcs_ready(phy_common);
> > -               if (err)
> > -                       return err;
> > +       if (phy_common->mode == PHY_MODE_UFS_HS_B)
> > +               is_rate_B = true;
> >
> > -               phy_common->is_started = true;
> > +       err = phy_common->phy_spec_ops->calibrate(phy_common, is_rate_B);
>
> Is there always a calibrate phys_spec_ops function assigned?

Yeah. This whole table is only used to support phy-qcom-ufs-qmp-14nm.c
and phy-qcom-ufs-qmp-20nm.c. I don't even see any device trees using
phy-qcom-ufs-qmp-20nm.c. So it seemed okay to assume it was populated.

Powered by blists - more mailing lists