net: fec: only enable mdio interrupt before phy device link up
authorNimrod Andy <B38611@freescale.com>
Thu, 11 Dec 2014 01:20:33 +0000 (09:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Dec 2014 04:37:01 +0000 (23:37 -0500)
Before phy device link up, we only enable FEC mdio interrupt, which
is more reasonable.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 85c955e..8c5b15e 100644 (file)
@@ -1075,7 +1075,10 @@ fec_restart(struct net_device *ndev)
                fec_ptp_start_cyclecounter(ndev);
 
        /* Enable interrupts we wish to service */
-       writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+       if (fep->link)
+               writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+       else
+               writel(FEC_ENET_MII, fep->hwp + FEC_IMASK);
 
        /* Init the interrupt coalescing */
        fec_enet_itr_coal_init(ndev);