From: Murali Karicheri <m-karicheri2@ti•com>
To: Florian Fainelli <f.fainelli@gmail•com>, <johan@kernel•org>,
"open list:TI NETCP ETHERNET DRIVER" <netdev@vger•kernel.org>,
"Kwok, WingMan" <w-kwok2@ti•com>
Subject: Re: Micrel Phy - Is there a way to configure the Phy not to do 802.3x flow control?
Date: Thu, 10 Mar 2016 17:51:09 -0500 [thread overview]
Message-ID: <56E1FA5D.9090003@ti.com> (raw)
In-Reply-To: <56E1CD4D.20405@ti.com>
On 03/10/2016 02:38 PM, Murali Karicheri wrote:
> On 03/10/2016 01:05 PM, Florian Fainelli wrote:
>> On 10/03/16 08:48, Murali Karicheri wrote:
>>> On 03/03/2016 07:16 PM, Florian Fainelli wrote:
>>>> On 03/03/16 14:18, Murali Karicheri wrote:
>>>>> Hi,
>>>>>
>>>>> We are using Micrel Phy in one of our board and wondering if we can force the
>>>>> Phy to disable flow control at start. I have a 1G ethernet switch connected
>>>>> to Phy and the phy always enable flow control. I would like to configure the
>>>>> phy not to flow control. Is that possible and if yes, what should I do in the
>>>>> my Ethernet driver to tell the Phy not to enable flow control?
>>>>
>>>> The PHY is not doing flow control per-se, your pseudo Ethernet MAC in
>>>> the switch is doing, along with the link partner advertising support for
>>>> it. You would want to make sure that your PHY device interface (provided
>>>> that you are using the PHY library) is not starting with Pause
>>>> advertised, but it could be supported.
>>>
>>> Understood that Phy is just advertise FC. The Micrel phy for 9031 advertise
>>> by default FC supported. After negotiation, I see that Phylib provide the
>>> link status with parameter pause = 1, asym_pause = 1. How do I tell the Phy not
>>> to advertise?
>>>
>>> I call following sequence in the Ethernet driver.
>>>
>>> of_phy_connect(x,y,hndlr,a,z);
>>
>> Here you should be able to change phydev->advertising and
>> phydev->supported to mask the ADVERTISED_Pause | ADVERTISED_AsymPause
>> bits and have phy_start() restart with that which should disable pause
>> and asym_pause as seen by your adjust_link handler.
>>
> Ok. Good point. I will try this. Thanks for your suggestion.
>
I made following changes. The phylib still report flow control enabled to
the driver. Some bug in the phylib/phydev?
+
+ printk("slave->phy->supported %x, slave->phy->advertising %x\n",
+ slave->phy->supported, slave->phy->advertising);
+ slave->phy->supported &=
+ ~(SUPPORTED_Pause | SUPPORTED_Asym_Pause);
+ slave->phy->advertising = slave->phy->supported;
+ printk("slave->phy->supported %x, slave->phy->advertising %x\n",
+ slave->phy->supported, slave->phy->advertising);
phy_start(slave->phy);
+ printk("slave->phy->supported %x, slave->phy->advertising %x\n",
+ slave->phy->supported, slave->phy->advertising);
phy_read_status(slave->phy);
[ 10.757001] slave->phy->supported 22ff, slave->phy->advertising 22ff
[ 10.763354] slave->phy->supported 2ff, slave->phy->advertising 2ff
[ 10.769552] slave->phy->supported 2ff, slave->phy->advertising 2ff
[ 10.776045] netcp-1.0 2620110.netcp eth0: Link is Down
udhcpc (v1.23.1) started
Sending discover...
Sending discover...
[ 14.757280] netcp-1.0 2620110.netcp eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Sending discover...
Sending select for 158.218.103.170...
Lease of 158.218.103.170 obtained, lease time 28800
/etc/udhcpc.d/50default: Adding DNS 192.0.2.2
/etc/udhcpc.d/50default: Adding DNS 192.0.2.3
> Murali
>>> phy_start()
>>>
>>> Now in hndlr() I have pause = 1, asym_pause = 1, in phy_device ptr. How can
>>> I tell the phy not to advertise initially?
>
>
--
Murali Karicheri
Linux Kernel, Keystone
next prev parent reply other threads:[~2016-03-10 22:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 22:18 Micrel Phy - Is there a way to configure the Phy not to do 802.3x flow control? Murali Karicheri
2016-03-03 22:26 ` Andrew Lunn
2016-03-10 15:07 ` Murali Karicheri
2016-03-04 0:16 ` Florian Fainelli
2016-03-10 16:48 ` Murali Karicheri
2016-03-10 18:05 ` Florian Fainelli
2016-03-10 19:38 ` Murali Karicheri
2016-03-10 22:51 ` Murali Karicheri [this message]
2016-03-11 18:31 ` Murali Karicheri
2016-03-11 19:51 ` Florian Fainelli
2016-03-16 15:08 ` Murali Karicheri
2016-03-16 15:16 ` Murali Karicheri
2016-03-18 0:10 ` Florian Fainelli
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=56E1FA5D.9090003@ti.com \
--to=m-karicheri2@ti$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=johan@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=w-kwok2@ti$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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