From 6c8f343ecc8dcddfbefaaa8d14082a0903707f80 Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Thu, 21 Jul 2016 11:42:54 +1000 Subject: [PATCH] net/faraday: Disallow using reversed MAC address from hardware The initial MAC address is retrieved from hardware if it's not provided by device-tree. The reserved MAC address from hardware will be used if non-reserved MAC address is invalid. It will cause mismatched MAC address seen by hardware and software. This disallows using the reserved hardware MAC address to avoid the mismatched MAC address seen by hardware and software. Fixes: 4a052c4624c3 ("net/faraday: Read MAC address from chip") Suggested-by: David Laight Suggested-by: Benjamin Herrenschmidt Signed-off-by: Gavin Shan Signed-off-by: David S. Miller --- drivers/net/ethernet/faraday/ftgmac100.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 2d4c7eab8b36b..36361f8bf8945 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -163,15 +163,6 @@ static void ftgmac100_setup_mac(struct ftgmac100 *priv) mac[4] = (l >> 8) & 0xff; mac[5] = l & 0xff; - if (!is_valid_ether_addr(mac)) { - mac[5] = (m >> 8) & 0xff; - mac[4] = m & 0xff; - mac[3] = (l >> 24) & 0xff; - mac[2] = (l >> 16) & 0xff; - mac[1] = (l >> 8) & 0xff; - mac[0] = l & 0xff; - } - 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); -- 2.39.5