MLK-11307 net: fec: disable timer interrupt when link down and suspend
authorFugang Duan <b38611@freescale.com>
Fri, 31 Jul 2015 04:27:05 +0000 (12:27 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:28 +0000 (14:47 -0500)
There exists one issue in Android environment when do power key on/off
test that cause system hang. Because suspend function disable enet all
clocks while timer interrupt comming that introduces registers access.
When link down and suspend, the timer interrupt is not necessary
to enable, so disable it.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Tested-by: Fugang Duan <B38611@freescale.com>
Tested-by: Chen Guoyin <B07211@freescale.com>
Tested-by: Zhu Wenbo <B52619@freescale.com>
(cherry picked from commit: 048f62891bc4936991fd58dbaf4a606a30282404)

drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c

index 2982850..9e6e6f1 100644 (file)
@@ -380,6 +380,7 @@ struct bufdesc_ex {
 #define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII | FEC_ENET_TS_TIMER)
 #define FEC_NAPI_IMASK (FEC_ENET_MII | FEC_ENET_TS_TIMER)
 #define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF))
+#define FEC_TIMER_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_TS_TIMER))
 
 #define FEC_ENET_ETHEREN       ((uint)0x00000002)
 
index 89e331c..99b43bb 100644 (file)
@@ -1137,9 +1137,9 @@ fec_stop(struct net_device *ndev)
                        writel(1, fep->hwp + FEC_ECNTRL);
                        udelay(10);
                }
-               writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+               writel(FEC_TIMER_DISABLED_IMASK, fep->hwp + FEC_IMASK);
        } else {
-               writel(FEC_DEFAULT_IMASK | FEC_ENET_WAKEUP, fep->hwp + FEC_IMASK);
+               writel(FEC_TIMER_DISABLED_IMASK | FEC_ENET_WAKEUP, fep->hwp + FEC_IMASK);
                val = readl(fep->hwp + FEC_ECNTRL);
                val |= (FEC_ECR_MAGICEN | FEC_ECR_SLEEP);
                writel(val, fep->hwp + FEC_ECNTRL);