summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorRogerio Pimentel <rogerio.pimentel@freescale.com>2011-12-26 10:23:48 -0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:19:33 +0800
commit579d8fde0a6b676965b5c70664817ee01323590f (patch)
tree7da7073525a83cbe6c573d74eefb21da636631f9 /drivers/net
parenta16493e3962def4674a8ca18fd6a44adb1738471 (diff)
ENGR00161871: ENET: Changing MDIO read and write timeout
The original FEC_MII_TIMEOUT was set to 1ms, which is too low when passed to the usecs_to_jiffies macro. On ARM one jiffy is 10ms, so use msecs_to_jiffies instead and use a timeout of 30ms, which corresponds to 3 jiffies. After running 3 hours NFS boots, the MDIO timeout do not occur anymore. Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
Diffstat (limited to 'drivers/net')
-rwxr-xr-xdrivers/net/fec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index c3cb63799c73..18d356e0a8eb 100755
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -246,7 +246,7 @@ static void fec_stop(struct net_device *dev);
#define FEC_MMFR_TA (2 << 16)
#define FEC_MMFR_DATA(v) (v & 0xffff)
-#define FEC_MII_TIMEOUT 2000 /* us */
+#define FEC_MII_TIMEOUT 30 /* ms */
/* Transmitter timeout */
#define TX_TIMEOUT (2 * HZ)
@@ -753,7 +753,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
/* wait for end of transfer */
time_left = wait_for_completion_timeout(&fep->mdio_done,
- usecs_to_jiffies(FEC_MII_TIMEOUT));
+ msecs_to_jiffies(FEC_MII_TIMEOUT));
if (time_left == 0) {
fep->mii_timeout = 1;
printk(KERN_ERR "FEC: MDIO read timeout, mii_id=%d\n", mii_id);
@@ -781,7 +781,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
/* wait for end of transfer */
time_left = wait_for_completion_timeout(&fep->mdio_done,
- usecs_to_jiffies(FEC_MII_TIMEOUT));
+ msecs_to_jiffies(FEC_MII_TIMEOUT));
if (time_left == 0) {
fep->mii_timeout = 1;
printk(KERN_ERR "FEC: MDIO write timeout, mii_id=%d\n", mii_id);