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.
Fugang Duan (3):
net: fec: reset fep link status in suspend function
net: fec: clear all interrupt events to support i.MX6SX
net: fec: only enable mdio interrupt before phy device link up
drivers/net/ethernet/freescale/fec_main.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
--
1.7.8
For i.MX6SX FEC controller, there have interrupt mask and event
field extension. To support all SOCs FEC, we clear all interrupt
events during MAVC initial process.
Signed-off-by: Fugang Duan <redacted>
---
drivers/net/ethernet/freescale/fec_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Before phy device link up, we only enable FEC mdio interrupt, which
is more reasonable.
Signed-off-by: Fugang Duan <redacted>
---
drivers/net/ethernet/freescale/fec_main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
@@ -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);
On some i.MX6 serial boards, phy power and refrence clock are supplied
or controlled by SOC. When do suspend/resume test, the power and clock
are disabled, so phy device link down.
For current driver, fep->link is still up status, which cause extra operation
like below code. To avoid the dumy operation, we set fep->link to down when
phy device is real down.
...
if (fep->link) {
napi_disable(&fep->napi);
netif_tx_lock_bh(ndev);
fec_stop(ndev);
netif_tx_unlock_bh(ndev);
napi_enable(&fep->napi);
fep->link = phy_dev->link;
status_change = 1;
}
...
Signed-off-by: Fugang Duan <redacted>
---
drivers/net/ethernet/freescale/fec_main.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
@@ -3332,6 +3332,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+*SOCcontrolphyregulator,whenregulatorisdisabled,phylinkdown+*/+if(fep->clk_enet_out||fep->reg_phy)+fep->link=0;+return0;}
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.