From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>,
Yan Markman <ymarkman@marvell.com>
Cc: Antoine Tenart <antoine.tenart@free-electrons.com>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"gregory.clement@free-electrons.com"
<gregory.clement@free-electrons.com>,
"thomas.petazzoni@free-electrons.com"
<thomas.petazzoni@free-electrons.com>,
"miquel.raynal@free-electrons.com"
<miquel.raynal@free-electrons.com>,
Nadav Haklai <nadavh@marvell.com>,
"mw@semihalf.com" <mw@semihalf.com>,
Stefan Chulski <stefanc@marvell.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXT] Re: [PATCH net] net: phylink: fix link state on phy-connect
Date: Fri, 1 Dec 2017 11:07:22 -0600 [thread overview]
Message-ID: <51496048-7e11-e0aa-7c47-3c04eee70e3a@ti.com> (raw)
In-Reply-To: <20171130132830.GA5529@n2100.armlinux.org.uk>
Hi Russell,
On 11/30/2017 07:28 AM, Russell King - ARM Linux wrote:
> On Thu, Nov 30, 2017 at 10:10:18AM +0000, Russell King - ARM Linux wrote:
>> On Thu, Nov 30, 2017 at 08:51:21AM +0000, Yan Markman wrote:
>>> The phylink_stop is called before phylink_disconnect_phy
>>> You could see in mvpp2.c:
>>>
>>> mvpp2_stop_dev() {
>>> phylink_stop(port->phylink);
>>> }
>>>
>>> mvpp2_stop() {
>>> mvpp2_stop_dev(port);
>>> phylink_disconnect_phy(port->phylink);
>>> }
>>>
>>> .ndo_stop = mvpp2_stop,
>>
>> Sorry, I don't have this in mvpp2.c, so I have no visibility of what
>> you're working with.
>>
>> What you have above looks correct, and I see no reason why the p21
>> patch would not have resolved your issue. The p21 patch ensures
>> that phylink_resolve() gets called and completes before phylink_stop()
>> returns. In that case, phylink_resolve() will call the mac_link_down()
>> method if the link is not already down. It will also print the "Link
>> is Down" message.
>>
>> Florian has already tested this patch after encountering a similar
>> issue, and has reported that it solves the problem for him. I've also
>> tested it with mvneta, and the original mvpp2x driver on Macchiatobin.
>>
>> Maybe there's something different about mvpp2, but as I have no
>> visibility of that driver and the modifications therein, I can't
>> comment further other than stating that it works for three different
>> implementations.
>>
>> Maybe you could try and work out what's going on with the p21 patch
>> in your case?
>
> I think I now realise what's probably going on.
>
> If you call netif_carrier_off() before phylink_stop(), then phylink will
> believe that the link is already down, and so it won't bother calling
> mac_link_down() - it will believe that the link is already down.
>
> I'll update the documentation for phylink_stop() to spell out this
> aspect.
>
There are pretty high number of net drivers which do call
netif_carrier_off(dev);
before
phy_stop(dev->phydev);
in .ndo_stop() callback.
As per you comment this seems to be incorrect, so should such calls be removed?
--
regards,
-grygorii
next prev parent reply other threads:[~2017-12-01 17:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-28 13:29 Antoine Tenart
2017-11-28 13:56 ` Andrew Lunn
2017-11-28 14:10 ` Antoine Tenart
2017-11-28 15:53 ` Russell King
2017-11-28 15:56 ` Russell King
2017-11-29 7:22 ` Antoine Tenart
2017-11-29 19:33 ` [EXT] " Yan Markman
2017-11-29 19:59 ` Russell King - ARM Linux
2017-11-29 21:06 ` [EXT] " Yan Markman
2017-11-29 21:20 ` Russell King - ARM Linux
2017-11-30 8:51 ` Yan Markman
2017-11-30 10:10 ` Russell King - ARM Linux
2017-11-30 13:28 ` Russell King - ARM Linux
2017-12-01 17:07 ` Grygorii Strashko [this message]
2017-12-01 17:24 ` Russell King - ARM Linux
2017-12-01 17:36 ` Florian Fainelli
2017-12-01 17:47 ` Russell King - ARM Linux
2017-12-02 11:08 ` Yan Markman
2017-12-02 14:58 ` Russell King - ARM Linux
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=51496048-7e11-e0aa-7c47-3c04eee70e3a@ti.com \
--to=grygorii.strashko@ti.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@free-electrons.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=gregory.clement@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=miquel.raynal@free-electrons.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=stefanc@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ymarkman@marvell.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
all inboxes | Powered by JetHome®