mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
Cc: barebox@lists.infradead.org, Philipp Zabel <pza@pengutronix.de>,
	Trent Piepho <tpiepho@kymetacorp.com>
Subject: Re: [PATCH] Fix genphy_restart_aneg() for Micrel's ksz9031.
Date: Wed, 15 Jun 2016 07:49:10 +0200	[thread overview]
Message-ID: <20160615054910.GC9677@pengutronix.de> (raw)
In-Reply-To: <CABDcavasLdCoH5gxWMrysjyVnGd5K_F+2=gi6CS1Xmaegkib8g@mail.gmail.com>

On Tue, Jun 14, 2016 at 09:39:23AM +0200, Guillermo Rodriguez Garcia wrote:
> Hi Sascha,
> 
> 2016-06-14 8:39 GMT+02:00 Sascha Hauer <s.hauer@pengutronix.de>:
> > Hi Guillermo,
> >
> > On Mon, Jun 13, 2016 at 07:29:15PM +0200, Guillermo Rodriguez Garcia wrote:
> >> From: grodriguez <guille.rodriguez@gmail.com>
> >>
> >> Commit da89ee8f2e04 ("Center FLP timing at 16ms") breaks
> >> genphy_restart_aneg() for Micrel's ksz9031. According to the
> >> datasheet, the ksz9031 requires a wait of 1ms after clearing
> >> the PDOWN bit and before read/write access to any PHY registers.
> >> ---
> >>  drivers/net/phy/phy.c |    9 ++++++++-
> >>  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > I must say that I am not overly happy with this patch as it leaks in phy
> > specific stuff into a somewhat generic function. Anyway, I see the need
> > for this patch and so I applied it.
> 
> Yes, I understand perfectly and I feel the same.
> The alternative was to create a custom genphy_restart_aneg for micrel
> PHYs only add the delay there, however I am not sure it is worth the
> trouble just for a 1ms delay which will be virtually unnoticeable
> anyway.

There's also the case when Micrel phy support is disabled. In this case
a Micrel phy is then handled by the generic phy, so we still need the
delay in the generic code, or we would have to remove the BMCR_PDOWN
setting from the generic code also.

> 
> Also I am not completely sure that this only applies to Micrel. See
> this for example in the SMSC911x driver from the Linux kernel:
> http://lxr.free-electrons.com/source/drivers/net/ethernet/smsc/smsc911x.c#L1364
> 
> Anyway if you would prefer this to be moved to micrel.c I would be
> happy to prepare a patch for that; just let me know.

Your patch is fine for now. Let's see what unforseen problems it
generates before changing it again ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-06-15  5:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABDcavZr1PCpFrHVJFFayRQZ6vninf-xFS0H9QKSdA8u53OkDg@mail.gmail.com>
2016-04-18 14:49 ` Fwd: Micrel KSZ9031RN PHY problem Guillermo Rodriguez Garcia
2016-04-19  7:11   ` Sascha Hauer
2016-04-20 15:58     ` Guillermo Rodriguez Garcia
2016-04-21  7:32       ` Sascha Hauer
2016-04-21 11:04         ` Guillermo Rodriguez Garcia
2016-04-26  9:55         ` Guillermo Rodriguez Garcia
2016-04-26 11:10           ` Guillermo Rodriguez Garcia
2016-04-27  5:59           ` Sascha Hauer
2016-04-28  9:51             ` Guillermo Rodriguez Garcia
2016-04-28 21:09               ` Trent Piepho
2016-04-29 11:00                 ` Guillermo Rodriguez Garcia
2016-04-29 18:18                   ` Trent Piepho
2016-05-03 14:40                     ` Guillermo Rodriguez Garcia
2016-05-04  7:43                       ` Sascha Hauer
2016-05-04 10:39                         ` Guillermo Rodriguez Garcia
2016-06-13 17:29                         ` [PATCH] Fix genphy_restart_aneg() for Micrel's ksz9031 Guillermo Rodriguez Garcia
2016-06-14  6:39                           ` Sascha Hauer
2016-06-14  7:39                             ` Guillermo Rodriguez Garcia
2016-06-15  5:49                               ` Sascha Hauer [this message]
2016-06-15  7:44                                 ` Guillermo Rodriguez Garcia

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=20160615054910.GC9677@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=guille.rodriguez@gmail.com \
    --cc=pza@pengutronix.de \
    --cc=tpiepho@kymetacorp.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