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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 28 Apr 2019 23:08:14 +0200
From:   Petr Štetiar <ynezz@...e.cz>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     netdev@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        "David S. Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        Alban Bedel <albeu@...e.fr>
Subject: Re: [PATCH v2 3/4] net: macb: Drop nvmem_get_mac_address usage

Andrew Lunn <andrew@...n.ch> [2019-04-28 18:56:37]:

Hi Andrew,

> On Sun, Apr 28, 2019 at 02:53:21PM +0200, Petr Štetiar wrote:
> > of_get_mac_address now uses NVMEM under the hood, so it's not necessary
> > to call it manually anymore.
> > 
> > Signed-off-by: Petr Štetiar <ynezz@...e.cz>
> > ---
> >  drivers/net/ethernet/cadence/macb_main.c | 12 +++---------
> >  1 file changed, 3 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> > index 3da2795..1b98bc8 100644
> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -4172,16 +4172,10 @@ static int macb_probe(struct platform_device *pdev)
> >  		bp->rx_intr_mask |= MACB_BIT(RXUBR);
> >  
> >  	mac = of_get_mac_address(np);
> > -	if (mac) {
> > +	if (mac)
> >  		ether_addr_copy(bp->dev->dev_addr, mac);
> > -	} else {
> > -		err = nvmem_get_mac_address(&pdev->dev, bp->dev->dev_addr);
> > -		if (err) {
> > -			if (err == -EPROBE_DEFER)
>
> The EPRODE_DEFER is interesting here. your change to
> of_get_mac_address() does not seem to handle that case. It probably
> should. We don't want it to fail and end up with a random MAC
> addresses etc, because the NVMEM has not probed yet.

so if I understand this correctly, it probably means, that this approach with
modified of_get_mac_address is dead end as current of_get_mac_address users
don't expect and handle possible -EPROBE_DEFER error, so I would need to
change all the current users, which is nonsense.

-- ynezz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ