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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 12 Dec 2020 13:38:09 -0600
From:   Adam Ford <aford173@...il.com>
To:     Sergei Shtylyov <sergei.shtylyov@...il.com>
Cc:     Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Adam Ford-BE <aford@...conembedded.com>,
        Charles Stevens <charles.stevens@...icpd.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] ravb: Add support for optional txc_refclk

On Sat, Dec 12, 2020 at 11:55 AM Sergei Shtylyov
<sergei.shtylyov@...il.com> wrote:
>
> Hello!
>
> On 12.12.2020 19:56, Adam Ford wrote:
>
> > The SoC expects the txv_refclk is provided, but if it is provided
> > by a programmable clock, there needs to be a way to get and enable
> > this clock to operate.  It needs to be optional since it's only
> > necessary for those with programmable clocks.
> >
> > Signed-off-by: Adam Ford <aford173@...il.com>
> [...]
> > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> > index bd30505fbc57..4c3f95923ef2 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -2148,6 +2148,18 @@ static int ravb_probe(struct platform_device *pdev)
> >               goto out_release;
> >       }
> >
> > +     priv->ref_clk = devm_clk_get(&pdev->dev, "txc_refclk");
>
>     Why not devm_clk_get_optional()?

I am not that familiar with the clock API.  I'll look into that
function. It looks like it makes more sense.  I'll send a V2.

adam
>
> > +     if (IS_ERR(priv->ref_clk)) {
> > +             if (PTR_ERR(priv->ref_clk) == -EPROBE_DEFER) {
> > +                     /* for Probe defer return error */
> > +                     error = PTR_ERR(priv->ref_clk);
> > +                     goto out_release;
> > +             }
> > +             /* Ignore other errors since it's optional */
> > +     } else {
> > +             (void)clk_prepare_enable(priv->ref_clk);
> > +     }
> > +
> >       ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
> >       ndev->min_mtu = ETH_MIN_MTU;
> >
>
> MBR, Sergei

Powered by blists - more mailing lists