Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Timo Teräs" <timo.teras@iki.fi>
Cc: "Phil Sutter" <phil@nwl.cc>,
	"françois romieu" <romieu@fr.zoreil.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] Re: still having r8169 woes with XID 18000000
Date: Sat, 05 Jun 2010 11:13:21 +0200	[thread overview]
Message-ID: <1275729201.5238.2.camel@edumazet-laptop> (raw)
In-Reply-To: <4C09FF4B.4050601@iki.fi>

Le samedi 05 juin 2010 à 10:39 +0300, Timo Teräs a écrit :

> Ok, I compared Realtek's and the in-tree driver. The only essential
> difference is that Realtek driver uses udelay(100) in mdio_write()'s
> busy polling loop where as the in-tree uses udelay(25). And that seems
> to be the magic difference! Using udelay(100) fixes this!
> 
> I'm guessing that the phy needs slight delay between consecutive
> mdio_write's even if it has advertised that the write has been
> completed. And yes, just adding a small delay in the end of mdio_write
> does seem to work too.
> 
> Francois, you think the below patch is ok? Should I send it as properly
> formatted commit?
> 
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index 217e709..6db62bf 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
> @@ -559,6 +559,7 @@ static void mdio_write(void __iomem *ioaddr,
>  			break;
>  		udelay(25);
>  	}
> +	udelay(25);
>  }
> 
>  static int mdio_read(void __iomem *ioaddr, int reg_addr)
> --

Sure this deserves an official patch with all prereqs, but please add a
comment in mdio_write() why this extra udelay(25) is needed, especially
since you say of udelay(100) 'fixes the bug'.




  parent reply	other threads:[~2010-06-05  9:13 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 [this message]
2010-06-05  9:21               ` Timo Teräs
2010-06-05 10:21                 ` [PATCH] r8169: fix random mdio_write failures Timo Teräs
2010-06-05 12:41                   ` 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=1275729201.5238.2.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=romieu@fr.zoreil.com \
    --cc=timo.teras@iki.fi \
    /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