Skip to content

Commit

Permalink
Merge branch 'fec-next'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
davem330 committed Dec 11, 2014
2 parents 198bf1b + 0c5a3ae commit 52c9b12
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 52c9b12

Please sign in to comment.