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: Sun, 19 Feb 2017 21:42:20 -0800 [thread overview]
Message-ID: <dfde5fbd-e4de-7b6d-37a6-dba1720cc3d9@gmail.com> (raw)
In-Reply-To: <8729016553E3654398EA69218DA29EEF15A807CA@cnshjmbx02>
On 02/19/2017 09:23 PM, YUAN Linyu wrote:
> 1. the main issue is mdio driver mixed with phy driver/ethernet driver.
You can have a standalone MDIO bus driver located anywhere you want in
the kernel tree. See drivers/net/ethernet/marvell/mvmdio.c for an example.
> 2. move them together, it's easy to maintain, add, delete or optimization(we can do it step by step).
It may be easier, but whenever you make API changes, you need to make
sure they cover every user in tree. So half convinced about this
argument here.
>
> 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).
If this is a different kind of MDIO device, e.g: an USB/PCIe/SATA PHY,
there is no network device associated with those.
> 4. support mdio auto probe phy device.
That's already the case, even in a Device Tree enabled system if you
omit to provide a "reg" property for child nodes, the bus is
automatically scanned.
> For 3, 4 can take device tree as example,
> Current,
> ethernet@e4000 {
> phy-handle = <&rgmii_phy1>;
> phy-connection-type = "rgmii";
> };
>
> ethernet@e6000 {
> phy-handle = <&rgmii_phy2>;
> phy-connection-type = "rgmii";
> };
>
> mdio@fc000 {
> rgmii_phy1: ethernet-phy@1 {
> reg = <0x1>;
> };
> rgmii_phy2: ethernet-phy@2 {
> reg = <0x2>;
> };
> };
> After change,
> ethernet@e4000 {
> mdio-handle = <&mdio>;
> phy-reg = <0x1>;
> phy-connection-type = "rgmii";
> };
This is not providing anything more than the current representation, and
in fact, it's actually counter to the Device Tree representation where
nodes should be relative to their parent and describe their address with
standard properties (reg) which are to be interpreted relative to their
parent's node #address-cells and #size-cells properties. You are also
introducing two new properties (phy-reg) and (mdio-handle) which both
introduce an incompatible binding...
Seriously, what problem do you really want to solve that we can't do
today? It may just be easier to send patches and have all of us review them.
>
> ethernet@e6000 {
> mdio-handle = <&mdio>;
> phy-handle = <&rgmii_phy2>;
> phy-connection-type = "rgmii";
> };
>
> mdio: mdio@fc000 {
> reg = <xxx>;
> };
>
>
>> -----Original Message-----
>> From: Florian Fainelli [mailto:f.fainelli@gmail.com]
>> Sent: Monday, February 20, 2017 1:03 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 04:20 PM, YUAN Linyu wrote:
>>> Hi,
>>>
>>> I have an idea to create drivers/net/mdio and move mdio
>> drivers(drivers/net/phy/mdio-* | drivers/net/ethernet/xxx/mdio-yyy | ) into it.
>>>
>>> Do you think it is acceptable ?
>>
>> What problem are you trying to fix by doing such a move? Moving files
>> around mean that making stable backports are going to be much more painful.
>>
>> So without further explanation, does not sound like such a great idea.
>> --
>> Florian
--
Florian
next prev parent reply other threads:[~2017-02-20 5:42 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 [this message]
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
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=dfde5fbd-e4de-7b6d-37a6-dba1720cc3d9@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).