1. the main issue is mdio driver mixed with phy driver/ethernet driver.
2. move them together, it's easy to maintain, add, delete or optimization(we 
can do it step by step).

3. another idea is bind mdio device to network device
4. support mdio auto probe phy device.
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";
                        };

                        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.faine...@gmail.com]
> Sent: Monday, February 20, 2017 1:03 PM
> To: YUAN Linyu; David S . Miller; Andrew Lunn
> Cc: netdev@vger.kernel.org; cug...@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

Reply via email to