linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem <davem@davemloft.net>, "f.fainelli" <f.fainelli@gmail.com>,
	huangdaode <huangdaode@hisilicon.com>,
	"xuwei (O)" <xuwei5@hisilicon.com>,
	"Liguozhu (Kenneth)" <liguozhu@hisilicon.com>,
	"Zhuangyuzeng (Yisen)" <yisen.zhuang@huawei.com>,
	Gabriele Paoloni <gabriele.paoloni@huawei.com>,
	John Garry <john.garry@huawei.com>,
	Linuxarm <linuxarm@huawei.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"lipeng (Y)" <lipeng321@huawei.com>, tremyfr <tremyfr@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback
Date: Mon, 3 Jul 2017 17:57:05 +0800	[thread overview]
Message-ID: <a678e5ae-4ce8-4d96-2c37-f9af02250733@huawei.com> (raw)
In-Reply-To: <20170701151707.GA5859@lunn.ch>

Hi, Andrew

On 2017/7/1 23:17, Andrew Lunn wrote:
> On Sat, Jul 01, 2017 at 11:57:32AM +0000, linyunsheng wrote:
>> Hi, Andrew
>>
>> I am agreed wih you on this.
>> But self test is also a feature of our product, and our
>> customer way choose to diagnose a problem using
>> self test, even if self test does not give a clear
>> reason to the problem.
>> we don't want to remove a feature that we don't
>> know when our customer will be using.
> 
> Far enough. So please take a close look at the code and try to fix
> it. The corner cases are your problem, a down'ed interface, WOL, etc.
> It is issues like this which can result in phy_resume() being called
> without there first being a phy_suspend.
> 
I looked into how the phy core deal with down'ed interface, WOL problem,
here is what I found:
1.phydev->state is used to track the state of the phy.
2.phy_start/stop and phy_state_machine work together to make sure the
  phydev->state is consistent with phydev->suspended.

And using phy_start/stop instead of phy_resume/suspend should take care
of down'ed interface problem.
Will using phy_start/stop cause other problems?

As for WOL,
phy_state_machine:
	if (needs_aneg)
		err = phy_start_aneg_priv(phydev, false);
	else if (do_suspend)
		phy_suspend(phydev);

I think the phy core also have the same problem, because above code does
not put the phy into suspending when it is WOL'ed, and it do not check the
return value of phy_suspend.

I hope I am not missing something obvious.
Please let me know if you have any idea about WOL problem, thanks.

Best Regards
Yunsheng Lin

      reply	other threads:[~2017-07-03  9:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26  2:10 [PATCH NET V5 0/2] Add loopback support in phy_driver and hns ethtool fix Lin Yun Sheng
2017-06-26  2:10 ` [PATCH NET V5 1/2] net: phy: Add phy loopback support in net phy framework Lin Yun Sheng
2017-06-26 13:43   ` Andrew Lunn
2017-06-26 16:45   ` Florian Fainelli
2017-06-26  2:10 ` [PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback Lin Yun Sheng
2017-06-26 13:42   ` Andrew Lunn
2017-06-27  3:25     ` Yunsheng Lin
2017-06-27 13:29       ` Andrew Lunn
2017-06-28  0:59         ` Yunsheng Lin
2017-06-28 20:28           ` Andrew Lunn
2017-06-29  2:35             ` Yunsheng Lin
2017-06-29 13:56               ` Andrew Lunn
2017-06-30  9:14                 ` Yunsheng Lin
2017-06-30 13:39                   ` Andrew Lunn
2017-07-01 15:17                     ` Andrew Lunn
2017-07-03  9:57                       ` Yunsheng Lin [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=a678e5ae-4ce8-4d96-2c37-f9af02250733@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=huangdaode@hisilicon.com \
    --cc=john.garry@huawei.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tremyfr@gmail.com \
    --cc=xuwei5@hisilicon.com \
    --cc=yisen.zhuang@huawei.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).