|
@@ -3031,6 +3031,14 @@ fec_set_mac_address(struct net_device *ndev, void *p)
|
|
|
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
|
|
}
|
|
|
|
|
|
+ /* Add netif status check here to avoid system hang in below case:
|
|
|
+ * ifconfig ethx down; ifconfig ethx hw ether xx:xx:xx:xx:xx:xx;
|
|
|
+ * After ethx down, fec all clocks are gated off and then register
|
|
|
+ * access causes system hang.
|
|
|
+ */
|
|
|
+ if (!netif_running(ndev))
|
|
|
+ return 0;
|
|
|
+
|
|
|
writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
|
|
|
(ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
|
|
|
fep->hwp + FEC_ADDR_LOW);
|