mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
davinci_mdio: Fix MDIO timeout check
commit 5b76d0600b 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c85ed6a569
commit
590999cbb2
|
|
@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
|
|||
__davinci_mdio_reset(data);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
reg = __raw_readl(®s->user[0].access);
|
||||
if ((reg & USERACCESS_GO) == 0)
|
||||
return 0;
|
||||
|
||||
dev_err(data->dev, "timed out waiting for user access\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user