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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPv3WKfX8coEcTAR9gdt=Pg=V_UHZ0tMzRfOdGz6jemYsV3UqQ@mail.gmail.com>
Date:   Fri, 4 Dec 2020 18:19:14 +0100
From:   Marcin Wojtas <mw@...ihalf.com>
To:     Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        Ziji Hu <huziji@...vell.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Grzegorz Jaszczyk <jaz@...ihalf.com>,
        Tomasz Nowicki <tn@...ihalf.com>,
        Ard Biesheuvel <ard.biesheuvel@....com>,
        Kostya Porotchkin <kostap@...vell.com>
Subject: Re: [PATCH v3 3/4] mmc: sdhci-xenon: use clk only with DT

pt., 4 gru 2020 o 14:51 Ulf Hansson <ulf.hansson@...aro.org> napisaƂ(a):
>
> On Wed, 2 Dec 2020 at 19:51, Marcin Wojtas <mw@...ihalf.com> wrote:
> >
> > As a preparation for supporting ACPI, modify the driver
> > to use the clk framework only when booting with DT -
> > otherwise rely on the configuration done by firmware.
> > For that purpose introduce also a custom SDHCI get_max_clock
> > callback.
> >
> > Signed-off-by: Marcin Wojtas <mw@...ihalf.com>
> > Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> > ---
> >  drivers/mmc/host/sdhci-xenon.c | 61 ++++++++++++--------
> >  1 file changed, 38 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
>
> [...]
>
> > @@ -637,10 +650,12 @@ static int xenon_runtime_resume(struct device *dev)
> >         struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host);
> >         int ret;
> >
> > -       ret = clk_prepare_enable(pltfm_host->clk);
> > -       if (ret) {
> > -               dev_err(dev, "can't enable mainck\n");
> > -               return ret;
> > +       if (dev->of_node) {
>
> I didn't notice this in the earlier version, my apologies, but there
> is no need for this check.
>
> clk_prepare_enable() should cope fine with a NULL argument - and you
> only reach this path, if the clock was successfully fetched during the
> probe or that it was left to stay NULL for non-DT case.

You are right, thanks! I applied the change and resent v4.

Best regards,
Marcin

>
> > +               ret = clk_prepare_enable(pltfm_host->clk);
> > +               if (ret) {
> > +                       dev_err(dev, "can't enable mainck\n");
> > +                       return ret;
> > +               }
> >         }
> >
> >         if (priv->restore_needed) {
> > --
> > 2.29.0
> >
>
> Kind regards
> Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ