From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Yegor Yefremov <yegorslists@googlemail.com>
Cc: netdev <netdev@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Grygorii Strashko <grygorii.strashko@ti.com>,
"N, Mugunthan V" <mugunthanvnm@ti.com>,
Rami Rosen <roszenrami@gmail.com>,
Fabrice GASNIER <fabrice.gasnier@st.com>
Subject: Re: [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers
Date: Fri, 2 Dec 2016 10:11:10 +0100 [thread overview]
Message-ID: <2b4912e6-c380-b2bd-762a-d1da2b0a7d82@st.com> (raw)
In-Reply-To: <11549d93-4b51-25c8-e693-509048475bef@gmail.com>
Hi Florian
sorry for my delay.
On 11/24/2016 7:23 PM, Florian Fainelli wrote:
> +Peppe,
>
> Le 24/11/2016 à 07:38, Andrew Lunn a écrit :
>>> As for enabling advertising and correct working of cpsw do you mean it
>>> would be better to disable EEE in any PHY on cpsw initialization as
>>> long as cpsw doesn't provide support for EEE?
>>>
>>> We observe some strange behavior with our gigabit PHYs and a link
>>> partner in a EEE-capable unmanaged NetGear switch. Disabling
>>> advertising seems to help. Though we're still investigating the issue.
>>
>> Hi Florian
>>
>> Am i right in saying, a PHY should not advertise EEE until the MAC
>> driver calls phy_init_eee(), indicating the MAC supports EEE?
>
> You would think so, but I don't see how this could possibly work if that
> was not the case already, see below.
>
>>
>> If so, it looks like we need to change a few of the PHY drivers, in
>> particular, the bcm-*.c.
>
> The first part that bcm-phy-lib.c does is make sure that EEE is enabled
> such that this gets reflected in MDIO_PCS_EEE_ABLE, without this, we
> won't be able to pass the first test in phy_init_eee(). The second part
> is to advertise EEE such that this gets reflected in MDIO_AN_EEE_ADV,
> also to make sure that we can pass the second check in phy_init_eee().
>
> Now, looking at phy_init_eee(), and what stmmac does (and bcmgenet,
> copied after stmmac), we need to somehow, have EEE advertised for
> phy_init_eee() to succeed, prepare the MAC to support EEE, and finally
> conclude with a call to phy_ethtool_set_eee(), which writes to the
> MDIO_AN_EEE_ADV register, and concludes the EEE auto-negotiated process.
> Since we already have EEE advertised, we are essentially just checking
> that the EEE advertised settings and the LP advertised settings actually
> do match, so it sounds like the final call to phy_ethtool_set_eee() is
> potentially useless if the resolved advertised and link partner
> advertised settings already match...
>
> So it sounds like at least, the first time you try to initialize EEE, we
> should start with EEE not advertised, and then, if we have EEE enabled
> at some point, and we re-negotiate the link parameters, somehow
> phy_init_eee() does a right job for that.
>
> Peppe, any thoughts on this?
I share what you say.
In sum, the EEE management inside the stmmac is:
- the driver looks at own HW cap register if EEE is supported
(indeed the user could keep disable EEE if bugged on some HW
+ Alex, Fabrice: we had some patches for this to propose where we
called the phy_ethtool_set_eee to disable feature at phy
level
- then the stmmac asks PHY layer to understand if transceiver and
partners are EEE capable.
- If all matches the EEE is actually initialized.
the logic above should be respected when use ethtool, hmm, I will
check the stmmac_ethtool_op_set_eee asap.
Hoping this is useful
Regards
Peppe
next prev parent reply other threads:[~2016-12-02 9:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 14:38 [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers yegorslists
2016-11-23 14:47 ` Rami Rosen
2016-11-23 17:33 ` Florian Fainelli
2016-11-23 20:08 ` Yegor Yefremov
2016-11-23 20:15 ` Florian Fainelli
2016-11-24 9:25 ` Yegor Yefremov
2016-11-24 15:38 ` Andrew Lunn
2016-11-24 18:23 ` Florian Fainelli
2016-12-02 9:11 ` Giuseppe CAVALLARO [this message]
2016-12-02 17:48 ` Florian Fainelli
2017-01-04 14:33 ` Florian Fainelli
2017-04-18 13:23 ` Niklas Cassel
2017-04-18 16:40 ` Florian Fainelli
2017-04-25 9:06 ` Niklas Cassel
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=2b4912e6-c380-b2bd-762a-d1da2b0a7d82@st.com \
--to=peppe.cavallaro@st.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=fabrice.gasnier@st.com \
--cc=grygorii.strashko@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=roszenrami@gmail.com \
--cc=yegorslists@googlemail.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).