aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGavin Schenk <g.schenk@eckelmann.de>2016-09-30 05:46:10 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-03 01:27:41 -0400
commitb82d44d78480faff7456e9e0999acb9d38666057 (patch)
treec738a32907d1d236e95e4424064175a68c27e83c /drivers/net
parent3a82e78c131a8199d38cf653b523c8fa2909df65 (diff)
net: fec: set mac address unconditionally
If the mac address origin is not dt, you can only safely assign a mac address after "link up" of the device. If the link is off the clocks are disabled and because of issues assigning registers when clocks are off the new mac address cannot be written in .ndo_set_mac_address() on some soc's. This fix sets the mac address unconditionally in fec_restart(...) and ensures consistency between fec registers and the network layer. Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de> Acked-by: Fugang Duan <fugang.duan@nxp.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Fixes: 9638d19e4816 ("net: fec: add netif status check before set mac address") Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 1fa2d87c2fc9..48a033e64423 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -913,13 +913,11 @@ fec_restart(struct net_device *ndev)
913 * enet-mac reset will reset mac address registers too, 913 * enet-mac reset will reset mac address registers too,
914 * so need to reconfigure it. 914 * so need to reconfigure it.
915 */ 915 */
916 if (fep->quirks & FEC_QUIRK_ENET_MAC) { 916 memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN);
917 memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN); 917 writel((__force u32)cpu_to_be32(temp_mac[0]),
918 writel((__force u32)cpu_to_be32(temp_mac[0]), 918 fep->hwp + FEC_ADDR_LOW);
919 fep->hwp + FEC_ADDR_LOW); 919 writel((__force u32)cpu_to_be32(temp_mac[1]),
920 writel((__force u32)cpu_to_be32(temp_mac[1]), 920 fep->hwp + FEC_ADDR_HIGH);
921 fep->hwp + FEC_ADDR_HIGH);
922 }
923 921
924 /* Clear any outstanding interrupt. */ 922 /* Clear any outstanding interrupt. */
925 writel(0xffffffff, fep->hwp + FEC_IEVENT); 923 writel(0xffffffff, fep->hwp + FEC_IEVENT);