diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-07-20 22:51:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-22 17:14:46 -0400 |
commit | 4bee1f9ac066ef0350b961eab9fedc4d0bd0a549 (patch) | |
tree | 6ca695f0f1387a322ae7d9ba2b1af8c90e2edb01 /drivers/net/fec.c | |
parent | 8cd47ea19bf8c6f9d3a41b3c312237d007138ae0 (diff) |
net/fec: restore interrupt mask after software-reset in fec_stop()
After the change from mdio polling to irq, it became necessary to
restore the interrupt mask after resetting the chip in fec_stop().
Otherwise, with all irqs disabled, no communication with the PHY will be
possible after e.g. un-/replugging the cable and the device gets
stalled.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r-- | drivers/net/fec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 391a553a3add..768b840aeb6b 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -118,6 +118,8 @@ static unsigned char fec_mac_default[] = { | |||
118 | #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ | 118 | #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ |
119 | #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ | 119 | #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ |
120 | 120 | ||
121 | #define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII) | ||
122 | |||
121 | /* The FEC stores dest/src/type, data, and checksum for receive packets. | 123 | /* The FEC stores dest/src/type, data, and checksum for receive packets. |
122 | */ | 124 | */ |
123 | #define PKT_MAXBUF_SIZE 1518 | 125 | #define PKT_MAXBUF_SIZE 1518 |
@@ -1213,8 +1215,7 @@ fec_restart(struct net_device *dev, int duplex) | |||
1213 | writel(0, fep->hwp + FEC_R_DES_ACTIVE); | 1215 | writel(0, fep->hwp + FEC_R_DES_ACTIVE); |
1214 | 1216 | ||
1215 | /* Enable interrupts we wish to service */ | 1217 | /* Enable interrupts we wish to service */ |
1216 | writel(FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII, | 1218 | writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); |
1217 | fep->hwp + FEC_IMASK); | ||
1218 | } | 1219 | } |
1219 | 1220 | ||
1220 | static void | 1221 | static void |
@@ -1233,8 +1234,8 @@ fec_stop(struct net_device *dev) | |||
1233 | /* Whack a reset. We should wait for this. */ | 1234 | /* Whack a reset. We should wait for this. */ |
1234 | writel(1, fep->hwp + FEC_ECNTRL); | 1235 | writel(1, fep->hwp + FEC_ECNTRL); |
1235 | udelay(10); | 1236 | udelay(10); |
1236 | |||
1237 | writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); | 1237 | writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); |
1238 | writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); | ||
1238 | } | 1239 | } |
1239 | 1240 | ||
1240 | static int __devinit | 1241 | static int __devinit |