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:   Mon, 21 Dec 2020 22:36:59 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Hongwei Zhang <hongweiz@....com>, linux-aspeed@...ts.ozlabs.org,
        linux-kernel@...r.kernel.org, openbmc@...ts.ozlabs.org,
        Jakub Kicinski <kuba@...nel.org>,
        David S Miller <davem@...emloft.net>
Cc:     netdev <netdev@...r.kernel.org>, Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...id.au>
Subject: Re: [Aspeed, v1 1/1] net: ftgmac100: Change the order of getting MAC
 address

Am 21.12.2020 um 21:51 schrieb Hongwei Zhang:
> Change the order of reading MAC address, try to read it from MAC chip
> first, if it's not availabe, then try to read it from device tree.
> 
This commit message leaves a number of questions. It seems the change
isn't related at all to the change that it's supposed to fix.

- What is the issue that you're trying to fix?
- And what is wrong with the original change?

> Fixes: 35c54922dc97 ("ARM: dts: tacoma: Add reserved memory for ramoops")
> Signed-off-by: Hongwei Zhang <hongweiz@....com>
> ---
>  drivers/net/ethernet/faraday/ftgmac100.c | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 65cd25372020..9be69cbdab96 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -184,14 +184,7 @@ static void ftgmac100_initial_mac(struct ftgmac100 *priv)
>  	unsigned int l;
>  	void *addr;
>  
> -	addr = device_get_mac_address(priv->dev, mac, ETH_ALEN);
> -	if (addr) {
> -		ether_addr_copy(priv->netdev->dev_addr, mac);
> -		dev_info(priv->dev, "Read MAC address %pM from device tree\n",
> -			 mac);
> -		return;
> -	}
> -
> +	/* Read from Chip if not from chip */

?!?

>  	m = ioread32(priv->base + FTGMAC100_OFFSET_MAC_MADR);
>  	l = ioread32(priv->base + FTGMAC100_OFFSET_MAC_LADR);
>  
> @@ -205,7 +198,18 @@ static void ftgmac100_initial_mac(struct ftgmac100 *priv)
>  	if (is_valid_ether_addr(mac)) {
>  		ether_addr_copy(priv->netdev->dev_addr, mac);
>  		dev_info(priv->dev, "Read MAC address %pM from chip\n", mac);
> -	} else {
> +		return;
> +	}
> +
> +	/* Read from Chip if not from device tree */

Isn't this how it works now?

> +	addr = device_get_mac_address(priv->dev, mac, ETH_ALEN);
> +	if (addr) {
> +		ether_addr_copy(priv->netdev->dev_addr, mac);
> +		dev_info(priv->dev, "Read MAC address %pM from device tree\n",
> +				mac);
> +		return;
> +	}
> +	else {
>  		eth_hw_addr_random(priv->netdev);
>  		dev_info(priv->dev, "Generated random MAC address %pM\n",
>  			 priv->netdev->dev_addr);
> 

Powered by blists - more mailing lists