netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>,
	Michal Simek <michal.simek@xilinx.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH regression] net: phy: fix initialization (config_init) for Marvel 88E1116R PHYs
Date: Wed, 02 Apr 2014 16:35:20 +0200	[thread overview]
Message-ID: <533C2028.7030604@ahsoftware.de> (raw)
In-Reply-To: <533BFD6B.7050503@cogentembedded.com>

Am 02.04.2014 14:07, schrieb Sergei Shtylyov:
> On 02-04-2014 15:51, Sergei Shtylyov wrote:
> 
>>> Commit 7cd1463664c2a15721ff4ccfb61d4d970815cb3d (introduced with 3.14)
>>> changed the initialization of the mv643xx_eth driver to use
>>> phy_init_hw()
>>> to reset the PHY. Unfortunately the initialization for the 88E1116R PHY
>>> was broken such, that it used mdelay() instead of really waiting for a
>>> reset to finish.

(...)

>>>
>>> -    mdelay(500);
>>> +    do
>>> +        temp = phy_read(phydev, MII_BMCR);
>>> +    while (temp & BMCR_RESET);
> 
>>     Not clear why it's necessary to reset one more time... Also, tight
>> loop
>> without a timeout (0.5 sec, specified by IEEE 802.3) doesn't look
>> good. The
>> comment above phy_poll_reset() suggests that it could be used in the PHY
>> drivers as well. Florian?
> 
>    Ah, I was looking at Linus' tree, not net-next.git, and hadn't read
> Florian's replies before commenting on this...

Just to be clear, this patch isn't a change request, it's a bugfix
because the ethernet doesn't come up on my Kirkwood device(s) using
kernel 3.14. So it's mainly meant for other people which want to use
3.14 with similiar devices and have problems too.

Reverting the above commit does do the trick here too.

I haven't looked at the datasheet nor any possible erratas. So I don't
know why and if there are multiple resets necessary. I've just made the
code more similiar to what was used before the above commit changed the
reset of the PHY. The tight loop is a copy from other m*_config_inits in
the same file and was in use in mv643xx_eth before the above commit too.
So at least the tight loop is proven to work. And genphy_soft_reset(),
which does not wait indefinitely long if the phy never does come out of
reset, is only available in some -next tree, definitely not where I look
at and need it for a bugfix.

But I agree, all the stuff looks very curious, tight loops without a
timeout, multiple resets in order and such things more.

But this patch isn't a cleanup, it's meant to be as small as possible to
make things work again. And I decided that instead of just suggesting a
revert, it's better to fix m88e1116r_config_init() which might be used
at other places too.

It might make sense to wait for some other users to complain, I think it
won't need long as this SOC is used in Sheevaplugs and Dockstars, some
ARMv5 devices which were quiet popular. Or if nobody else complains,
maybe someone might test my change. Ut could be possible that the
failing sequence is through the/my use of netconsole, which is, I
assume, not very common.

Regards,

Alexander Holler

      reply	other threads:[~2014-04-02 14:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 23:55 [PATCH regression] net: phy: fix initialization (config_init) for Marvel 88E1116R PHYs Alexander Holler
2014-04-02  0:00 ` Florian Fainelli
2014-04-02  0:57 ` Florian Fainelli
2014-04-02  9:09   ` Alexander Holler
2014-04-02 10:54     ` Alexander Holler
2014-04-02 19:01     ` Florian Fainelli
2014-04-02 20:25       ` Sebastian Hesselbarth
2014-04-02 22:12         ` Alexander Holler
2014-04-02 22:20           ` Florian Fainelli
2014-04-02 22:27           ` Sebastian Hesselbarth
2014-04-03  7:17             ` Alexander Holler
2014-04-03  8:49               ` Sebastian Hesselbarth
2014-04-03 15:06                 ` Alexander Holler
2014-04-03 15:14                   ` David Miller
2014-04-03 15:45                     ` Alexander Holler
2014-04-03 15:45                   ` Sebastian Hesselbarth
2014-04-03 15:58                     ` Alexander Holler
2014-04-03 17:58                       ` Bug(s) with netconsole (using mv643xx_eth on Kirkwood) Alexander Holler
2014-04-03 18:21                         ` Sebastian Hesselbarth
2014-04-03 18:23                           ` Alexander Holler
2014-04-03 18:39                           ` Alexander Holler
2014-04-03 18:44                             ` Florian Fainelli
2014-04-04 11:36                               ` Alexander Holler
2014-04-03 17:44                   ` [PATCH regression] net: phy: fix initialization (config_init) for Marvel 88E1116R PHYs Sebastian Hesselbarth
2014-04-03 18:20                     ` Alexander Holler
2014-04-02 22:30     ` Sebastian Hesselbarth
2014-04-02 11:51 ` Sergei Shtylyov
2014-04-02 12:07   ` Sergei Shtylyov
2014-04-02 14:35     ` Alexander Holler [this message]

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=533C2028.7030604@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stable@vger.kernel.org \
    /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).