提交 5b76d060 编写于 作者: C Christian Riesch 提交者: David S. Miller

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: NChristian Riesch <christian.riesch@omicron.at>
Cc: <stable@vger.kernel.org>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cda31e10
...@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) ...@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
__davinci_mdio_reset(data); __davinci_mdio_reset(data);
return -EAGAIN; return -EAGAIN;
} }
reg = __raw_readl(&regs->user[0].access);
if ((reg & USERACCESS_GO) == 0)
return 0;
dev_err(data->dev, "timed out waiting for user access\n"); dev_err(data->dev, "timed out waiting for user access\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册