From 59ec218f4b50333c9f507c748fb43d1f3359f784 Mon Sep 17 00:00:00 2001 From: Rogerio Pimentel Date: Mon, 26 Dec 2011 10:23:48 -0800 Subject: [PATCH] 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 --- drivers/net/fec.c | 6 +++--- 1 file 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); -- 2.39.5