]> git.baikalelectronics.ru Git - kernel.git/commit
davinci_mdio: Fix MDIO timeout check
authorChristian Riesch <christian.riesch@omicron.at>
Mon, 16 Apr 2012 04:35:25 +0000 (04:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Apr 2012 02:31:59 +0000 (22:31 -0400)
commit8076b5b4cd321b33901ef8354b39b7965f47ba21
treee30784093458a10899489d2cced27eb3641074dd
parentf6f8652c289ba09943edff68d71539c958baf0f7
davinci_mdio: Fix MDIO timeout check

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: <stable@vger.kernel.org>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_mdio.c