aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-11-01 01:32:20 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-11-03 15:23:15 -0500
commitee04448d8871e71f55520d62cf6adbf5dd403c99 (patch)
tree70ae1ffa1622b689350d00aaa052393e4094099f /drivers/net/mv643xx_eth.c
parent1d19ecfc65ed01bac7a58f83004057ad704ee7cc (diff)
mv643xx_eth: fix SMI bus access timeouts
The mv643xx_eth mii bus implementation uses wait_event_timeout() to wait for SMI completion interrupts. If wait_event_timeout() would return zero, mv643xx_eth would conclude that the SMI access timed out, but this is not necessarily true -- wait_event_timeout() can also return zero in the case where the SMI completion interrupt did happen in time but where it took longer than the requested timeout for the process performing the SMI access to be scheduled again. This would lead to occasional SMI access timeouts when the system would be under heavy load. The fix is to ignore the return value of wait_event_timeout(), and to re-check the SMI done bit after wait_event_timeout() returns to determine whether or not the SMI access timed out. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index a9c8c08044b1..b9dcdbd369f8 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1066,9 +1066,12 @@ static int smi_wait_ready(struct mv643xx_eth_shared_private *msp)
1066 return 0; 1066 return 0;
1067 } 1067 }
1068 1068
1069 if (!wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp), 1069 if (!smi_is_done(msp)) {
1070 msecs_to_jiffies(100))) 1070 wait_event_timeout(msp->smi_busy_wait, smi_is_done(msp),
1071 return -ETIMEDOUT; 1071 msecs_to_jiffies(100));
1072 if (!smi_is_done(msp))
1073 return -ETIMEDOUT;
1074 }
1072 1075
1073 return 0; 1076 return 0;
1074} 1077}