summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-12-11 05:37:06 +0100
committerDavid S. Miller <davem@davemloft.net>2014-12-11 05:37:06 +0100
commit52c9b12d380c8d83b9a34fee268142c53b5ad956 (patch)
tree4a549a98368a3f9baa6e552dc3072b4da535c070
parentnet: sock: fix access via invalid file descriptor (diff)
parentnet: fec: only enable mdio interrupt before phy device link up (diff)
downloadlinux-52c9b12d380c8d83b9a34fee268142c53b5ad956.tar.xz
linux-52c9b12d380c8d83b9a34fee268142c53b5ad956.zip
Merge branch 'fec-next'
Fugang Duan says: ==================== net: fec: driver code clean and bug fix The patch serial include code clean and bug fix: Patch#1: avoid dummy operation during suspend/resume test. Patch#2: bug fix for i.MX6SX SOC that clean all interrupt events during MAC initial process. Patch#3: before phy device link status is up, only enable MDIO bus interrupt. V2: - Modify the comment form from David's suggestion. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fee2afe47eb3..8c5b15ee5ed7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -940,7 +940,7 @@ fec_restart(struct net_device *ndev)
}
/* Clear any outstanding interrupt. */
- writel(0xffc00000, fep->hwp + FEC_IEVENT);
+ writel(0xffffffff, fep->hwp + FEC_IEVENT);
fec_enet_bd_init(ndev);
@@ -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);
@@ -3332,6 +3335,12 @@ static int __maybe_unused fec_suspend(struct device *dev)
if (fep->reg_phy)
regulator_disable(fep->reg_phy);
+ /* SOC supply clock to phy, when clock is disabled, phy link down
+ * SOC control phy regulator, when regulator is disabled, phy link down
+ */
+ if (fep->clk_enet_out || fep->reg_phy)
+ fep->link = 0;
+
return 0;
}