mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Hongwei Zhang <hongweiz@ami.com>,
	linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	openbmc@lists.ozlabs.org, Jakub Kicinski <kuba@kernel.org>,
	David S Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Joel Stanley <joel@jms.id.au>,
	Andrew Jeffery <andrew@aj.id.au>
Subject: Re: [Aspeed, v1 1/1] net: ftgmac100: Change the order of getting MAC address
Date: Mon, 21 Dec 2020 22:36:59 +0100	[thread overview]
Message-ID: <55803a8a-7ec9-5d60-04bd-d1e163174250@gmail.com> (raw)
In-Reply-To: <20201221205157.31501-2-hongweiz@ami.com>

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@ami.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);
> 


  reply	other threads:[~2020-12-21 21:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 20:51 [Aspeed, v1 0/1] " Hongwei Zhang
2020-12-21 20:51 ` [Aspeed, v1 1/1] " Hongwei Zhang
2020-12-21 21:36   ` Heiner Kallweit [this message]
2020-12-22 20:14   ` [Aspeed, v2 0/2] " Hongwei Zhang
2020-12-22 20:14   ` [Aspeed, v2 1/2] " Hongwei Zhang
2020-12-22 20:14   ` [Aspeed, v2 2/2] " Hongwei Zhang
2020-12-22 20:46     ` Heiner Kallweit
2020-12-22 21:00       ` Andrew Lunn
2020-12-28 22:01         ` Jakub Kicinski
2021-01-04 17:28   ` [Aspeed, v1 1/1] " Hongwei Zhang
2021-01-04 20:48     ` Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55803a8a-7ec9-5d60-04bd-d1e163174250@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@aj.id.au \
    --cc=davem@davemloft.net \
    --cc=hongweiz@ami.com \
    --cc=joel@jms.id.au \
    --cc=kuba@kernel.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome