diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-06-06 15:38:47 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-26 17:21:21 -0700 |
commit | 9ab48c2ea9806947d8f5fcadb0c47767c29f175c (patch) | |
tree | d360821697ed4c065ae7b073cb03ca73bae90f29 /drivers/net | |
parent | 0987a43dadd8a45843c906d674221b180488e42d (diff) |
r8169: fix random mdio_write failures
[ Upstream commit 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e ]
Some configurations need delay between the "write completed" indication
and new write to work reliably.
Realtek driver seems to use longer delay when polling the "write complete"
bit, so it waits long enough between writes with high probability (but
could probably break too). This patch adds a new udelay to make sure we
wait unconditionally some time after the write complete indication.
This caused a regression with XID 18000000 boards when the board specific
phy configuration writing many mdio registers was added in commit
2e955856ff (r8169: phy init for the 8169scd). Some of the configration
mdio writes would almost always fail, and depending on failure might leave
the PHY in non-working state.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Acked-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/r8169.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 211b587195c..3aafa535fa2 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -557,6 +557,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) break; udelay(25); } + /* + * Some configurations require a small delay even after the write + * completed indication or the next write might fail. + */ + udelay(25); } static int mdio_read(void __iomem *ioaddr, int reg_addr) |