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]
Date:   Mon, 20 Apr 2020 22:17:06 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Doug Berger <opendmb@...il.com>,
        bcm-kernel-feedback-list@...adcom.com,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH v1] net: bcmgenet: Use devm_clk_get_optional() to get the
 clocks

On Mon, Apr 20, 2020 at 11:33:07AM -0700, Florian Fainelli wrote:
> On 4/20/2020 11:30 AM, Andy Shevchenko wrote:
> > Conversion to devm_clk_get_optional() makes it explicit that clocks are
> > optional. This change allows to handle deferred probe in case clocks are
> > defined, but not yet probed. Due to above changes replace dev_dbg() by
> > dev_err() and bail out in error case.
> > 
> > While here, check potential error when enable main clock.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> >   .../net/ethernet/broadcom/genet/bcmgenet.c    | 25 +++++++++++--------
> >   1 file changed, 15 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> > index ef275db018f73..045f7b7f0b5d3 100644
> > --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> > +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> > @@ -3487,13 +3487,16 @@ static int bcmgenet_probe(struct platform_device *pdev)
> >   		priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH;
> >   	}
> > -	priv->clk = devm_clk_get(&priv->pdev->dev, "enet");
> > +	priv->clk = devm_clk_get_optional(&priv->pdev->dev, "enet");
> >   	if (IS_ERR(priv->clk)) {
> > -		dev_dbg(&priv->pdev->dev, "failed to get enet clock\n");
> > -		priv->clk = NULL;
> > +		dev_err(&priv->pdev->dev, "failed to get enet clock\n");
> 
> Please maintain the dev_dbg() here and likewise for the rest of your
> changes. With that:
> 
> Acked-by: Florian Fainelli <f.fainelli@...il.com>

Ah, I see, actually dev_err() will make too much noise in case of deferred probe.

Perhaps
	if (err != -EPROBE_DEFER)
		dev_err(...);
?

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ