ethoc: rework mdio read/write
authorJonas Bonn <jonas@southpole.se>
Thu, 25 Nov 2010 02:30:30 +0000 (02:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Nov 2010 19:16:37 +0000 (11:16 -0800)
commit8dac428ae9ae54d8e8540ac157d92925dd7ebed8
tree6d5c53fc4ad5167841ec2e87ed7745c6e4db4a66
parentfa98eb0e867c6c16e239545d4deb7ad8f40631b3
ethoc: rework mdio read/write

MDIO read and write were checking whether a timeout had expired to determine
whether to recheck the result of the MDIO operation.  Under heavy CPU usage,
however, it was possible for the timeout to expire before the routine got
around to be able to check a second time even, thus erroneousy returning an
-EBUSY.

This patch changes the the MDIO IO routines to try up to five times to complete
the operation before giving up, thus lessening the dependency on CPU load.

This resolves a problem whereby a ping flood would keep the CPU so busy that
the above problem would manifest itself; the MDIO command to check link status
would fail and the interface would erroneously be shut down.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethoc.c