From: Ivan Vecera <ivecera@redhat.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Tim Durack <tdurack@gmail.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: r8169 MAC problem
Date: Mon, 09 Mar 2009 09:56:45 +0100 [thread overview]
Message-ID: <49B4D9CD.4080803@redhat.com> (raw)
In-Reply-To: <20090306200515.GA26365@electric-eye.fr.zoreil.com>
Francois Romieu wrote:
> Please Cc: Ivan.
>
> Tim Durack <tdurack@gmail.com> :
> [...]
>> Any ideas?
>
> Damn me, I should have noticed that the delay was below spec :o(
Francois, you are right, but IMHO there is no problem with reading of MAC from
EEPROM (see log... "MAC address found...") but there is a problem with assignment
of this MAC.
Interesting is that Tim's eth0 and eth1 are affected but eth2 is working well
thought all of them have the same XID. Maybe some delay after leaving of programming
mode could help.
Ivan
>
> 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);
next prev parent reply other threads:[~2009-03-09 8:56 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
2009-03-07 14:48 ` Tim Durack
2009-03-09 8:56 ` Ivan Vecera [this message]
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=49B4D9CD.4080803@redhat.com \
--to=ivecera@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
--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 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).