From: Francois Romieu <romieu@fr.zoreil.com>
To: Tim Durack <tdurack@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Ivan Vecera <ivecera@redhat.com>
Subject: Re: r8169 MAC problem
Date: Fri, 6 Mar 2009 21:05:15 +0100 [thread overview]
Message-ID: <20090306200515.GA26365@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <9e246b4d0903061129g7b66dc3bm8013b75be671ca33@mail.gmail.com>
Please Cc: Ivan.
Tim Durack <tdurack@gmail.com> :
[...]
> Any ideas?
Damn me, I should have noticed that the delay was below spec :o(
Can you try the patch below on top of the current git kernel ?
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b347340..dfd42db 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1970,9 +1970,14 @@ static const struct net_device_ops rtl8169_netdev_ops = {
};
/* Delay between EEPROM clock transitions. Force out buffered PCI writes. */
-#define RTL_EEPROM_DELAY() RTL_R8(Cfg9346)
#define RTL_EEPROM_READ_CMD 6
+static void rtl_eeprom_delay(void __iomem *ioaddr)
+{
+ RTL_R8(Cfg9346);
+ ndelay(450);
+}
+
/* read 16bit word stored in EEPROM. EEPROM is addressed by words. */
static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)
{
@@ -1992,7 +1997,7 @@ static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)
/* enter programming mode */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
/* write command and requested address */
while (cmd_len--) {
@@ -2002,29 +2007,29 @@ static u16 rtl_eeprom_read(void __iomem *ioaddr, int addr)
/* write a bit */
RTL_W8(Cfg9346, x);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
/* raise clock */
RTL_W8(Cfg9346, x | Cfg9346_EESK);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
}
/* lower clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
/* read back 16bit value */
for (i = 16; i > 0; i--) {
/* raise clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS | Cfg9346_EESK);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
result <<= 1;
result |= (RTL_R8(Cfg9346) & Cfg9346_EEDO) ? 1 : 0;
/* lower clock */
RTL_W8(Cfg9346, Cfg9346_Program | Cfg9346_EECS);
- RTL_EEPROM_DELAY();
+ rtl_eeprom_delay(ioaddr);
}
RTL_W8(Cfg9346, Cfg9346_Program);
--
Ueimor
next prev parent reply other threads:[~2009-03-06 20:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <9e246b4d0903061127q7c82103dq88c5184765f3c17a@mail.gmail.com>
2009-03-06 19:29 ` r8169 MAC problem Tim Durack
2009-03-06 20:05 ` Francois Romieu [this message]
2009-03-07 14:48 ` Tim Durack
2009-03-09 8:56 ` Ivan Vecera
2009-03-09 13:27 ` Tim Durack
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=20090306200515.GA26365@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=ivecera@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tdurack@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.