From: "Timo Teräs" <timo.teras@iki.fi>
To: netdev@vger.kernel.org
Cc: "Timo Teräs" <timo.teras@iki.fi>,
"françois romieu" <romieu@fr.zoreil.com>,
"Edward Hsu" <edward_hsu@realtek.com.tw>
Subject: [PATCH] r8169: fix random mdio_write failures
Date: Sat, 5 Jun 2010 13:21:13 +0300 [thread overview]
Message-ID: <1275733273-28321-1-git-send-email-timo.teras@iki.fi> (raw)
In-Reply-To: <4C0A1736.9030209@iki.fi>
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>
Cc: françois romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
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 217e709..03a8318 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -559,6 +559,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)
--
1.7.0.4
next prev parent reply other threads:[~2010-06-05 10:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 12:10 still having r8169 woes with XID 18000000 Timo Teräs
2010-06-04 12:36 ` Phil Sutter
2010-06-04 13:02 ` Timo Teräs
2010-06-04 13:43 ` Phil Sutter
2010-06-04 17:31 ` Timo Teräs
2010-06-04 20:24 ` Timo Teräs
2010-06-05 7:39 ` [PATCH] " Timo Teräs
2010-06-05 9:02 ` David Miller
2010-06-05 9:13 ` Eric Dumazet
2010-06-05 9:21 ` Timo Teräs
2010-06-05 10:21 ` Timo Teräs [this message]
2010-06-05 12:41 ` [PATCH] r8169: fix random mdio_write failures Francois Romieu
2010-06-06 22:39 ` David Miller
2010-06-07 9:26 ` hayeswang
2010-06-07 21:51 ` Francois Romieu
2010-06-08 6:06 ` Timo Teräs
2010-06-08 6:26 ` Francois Romieu
2010-06-09 2:47 ` hayeswang
2010-06-09 5:22 ` [PATCH] r8169: fix mdio_read and update mdio_write according to hw specs Timo Teräs
2010-06-09 6:18 ` Francois Romieu
2010-06-10 0:32 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1275733273-28321-1-git-send-email-timo.teras@iki.fi \
--to=timo.teras@iki.fi \
--cc=edward_hsu@realtek.com.tw \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).