netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: YUAN Linyu <Linyu.Yuan@alcatel-sbell.com.cn>,
	"David S . Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"cugyly@163.com" <cugyly@163.com>
Subject: Re: create drivers/net/mdio and move mdio drivers into it
Date: Mon, 20 Feb 2017 14:30:10 -0800	[thread overview]
Message-ID: <6cec7d67-3e99-e97d-3720-2ae6884ce150@gmail.com> (raw)
In-Reply-To: <8729016553E3654398EA69218DA29EEF15A807FA@cnshjmbx02>



On 02/19/2017 10:26 PM, YUAN Linyu wrote:
> 
> 
>> -----Original Message-----
>> From: Florian Fainelli [mailto:f.fainelli@gmail.com]
>> Sent: Monday, February 20, 2017 2:16 PM
>> To: YUAN Linyu; David S . Miller; Andrew Lunn
>> Cc: netdev@vger.kernel.org; cugyly@163.com
>> Subject: Re: create drivers/net/mdio and move mdio drivers into it
>>
>>
>>
>> On 02/19/2017 10:10 PM, YUAN Linyu wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Florian Fainelli [mailto:f.fainelli@gmail.com]
>>>> Sent: Monday, February 20, 2017 1:42 PM
>>>> To: YUAN Linyu; David S . Miller; Andrew Lunn
>>>> Cc: netdev@vger.kernel.org; cugyly@163.com
>>>> Subject: Re: create drivers/net/mdio and move mdio drivers into it
>>>>> 3. another idea is bind mdio device to network device
>>>>
>>>> You would have to be more specific about what you want to do here. If
>>>> the MDIO device is e.g: a switch, what we recommend doing is provide a
>>>> fixed-link node that describes how the Ethernet MAC and the switch's
>>>> CPU/management ports are connected (that way the MAC always "sees"
>> the
>>>> link as UP, running with a specific speed and duplex).
>>>>
>>> Yes, some system will configured the phy to fixed speed/duplex at boot time,
>>> no phy driver used in kernel at all.
>>
>> There is always a PHY driver used, either is a dedicated one, or its the
>> generic PHY driver in drivers/net/phy/phy_device.c, even when fixed
>> PHYs/link are used.
>>
>>> If network device know mdio device it used, we can do phy dump through this
>>> mdio device driver.
>>
>> We are not going to accept MDIO device drivers whose only purpose is to
>> allow PHY devices register dumps. Implement a proper PHY driver for
>> these devices, if nothing needs to be done, you just need to call into
>> genphy_* functions, and just override how to do register dumps.
>>
> No, we discuss mdio driver here, not phy driver.
> I mean if a network device know mdio device it used, we use mdio driver to 
> dump any register of phy device even it's driver is not build.

The network device is supposed to attach to a PHY, which in turns has a
backing PHY driver, which is a superset of a MDIO device driver.

If the thing you are after is to be able to do PHY device register dumps
without a PHY driver to assist you with that, then we need to add whole
lot of things:

- have an ioctl() which allows stopping/freezing the PHY state machine
so dumps don't interfere with the PHY state

- have the ability to reliably perform PHY dumps that e.g: require page
programming etc. etc.

Then again, all of this could be done by a PHY driver reliably and in a
way that is consistent and predictable.
-- 
Florian

  reply	other threads:[~2017-02-20 22:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  0:20 create drivers/net/mdio and move mdio drivers into it YUAN Linyu
2017-02-20  5:03 ` Florian Fainelli
2017-02-20  5:23   ` YUAN Linyu
2017-02-20  5:42     ` Florian Fainelli
2017-02-20  6:10       ` YUAN Linyu
2017-02-20  6:15         ` Florian Fainelli
2017-02-20  6:26           ` YUAN Linyu
2017-02-20 22:30             ` Florian Fainelli [this message]
2017-02-20  6:29       ` YUAN Linyu
2017-02-20 22:31         ` Florian Fainelli
2017-02-21  0:47           ` YUAN Linyu
2017-02-22  5:38           ` YUAN Linyu
2017-02-22 10:21             ` Andrew Lunn
2017-02-23  0:10               ` YUAN Linyu
2017-02-23  9:30                 ` Andrew Lunn
2017-02-23  9:51                   ` YUAN Linyu
2017-02-23 10:29                     ` Andrew Lunn

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=6cec7d67-3e99-e97d-3720-2ae6884ce150@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Linyu.Yuan@alcatel-sbell.com.cn \
    --cc=andrew@lunn.ch \
    --cc=cugyly@163.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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).