davinci_mdio: Fix MDIO timeout check
authorChristian Riesch <christian.riesch@omicron.at>
Mon, 16 Apr 2012 04:35:25 +0000 (04:35 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:13:55 +0000 (13:13 +0100)
commit25c6d69f0166cdf2e0bb69d1c41614731ec8873d
tree7032f2453dcd6abcead584010f6b96d5b1506c5f
parent82738cc03fddc48211a5a5c845c192a914e4971c
davinci_mdio: Fix MDIO timeout check

commit 5b76d0600b2b08eef77f8e9226938b7b6bde3099 upstream.

Under heavy load (flood ping) it is possible for the MDIO timeout to
expire before the loop checks the GO bit again. This patch adds an
additional check whether the operation was done before actually
returning -ETIMEDOUT.

To reproduce this bug, flood ping the device, e.g., ping -f -l 1000
After some time, a "timed out waiting for user access" warning
may appear. And even worse, link may go down since the PHY reported a
timeout.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/ti/davinci_mdio.c