From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f65.google.com ([209.85.218.65]:46491 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754218AbeCSALT (ORCPT ); Sun, 18 Mar 2018 20:11:19 -0400 Received: by mail-oi0-f65.google.com with SMTP id x12so12917837oie.13 for ; Sun, 18 Mar 2018 17:11:19 -0700 (PDT) Subject: Re: [PATCH net-next 0/4] net: dsa: Plug in PHYLINK support To: netdev@vger.kernel.org Cc: privat@egil-hjelmeland.no, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, rmk+kernel@armlinux.org.uk, sean.wang@mediatek.com, Woojung.Huh@microchip.com, john@phrozen.org, cphealy@gmail.com References: <20180318185246.19311-1-f.fainelli@gmail.com> From: Florian Fainelli Message-ID: <5690f51e-e303-70ad-f08e-915674efd854@gmail.com> Date: Sun, 18 Mar 2018 17:11:14 -0700 MIME-Version: 1.0 In-Reply-To: <20180318185246.19311-1-f.fainelli@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/18/2018 11:52 AM, Florian Fainelli wrote: > Hi all, > > This patch series adds PHYLINK support to DSA which is necessary to support more > complex PHY and pluggable modules setups. > > Patch series can be found here: > > https://github.com/ffainelli/linux/commits/dsa-phylink > > This was tested on: > > - dsa-loop > - bcm_sf2 > - mv88e6xxx > - b53 > > With a variety of test cases: > - internal & external MDIO PHYs > - MoCA with link notification through interrupt/MMIO register > - built-in PHYs > - ifconfig up/down for several cycles works > - bind/unbind of the drivers > > And everything should still work as expected. Please be aware of the following: > > - switch drivers (like bcm_sf2) which may have user-facing network ports using > fixed links would need to implement phylink_mac_ops to remain functional. > PHYLINK does not create a phy_device for fixed links, therefore our > call to adjust_link() from phylink_mac_link_{up,down} would not be calling > into the driver. This *should not* affect CPU/DSA ports which are configured > through adjust_link() but have no network devices > > - support for SFP/SFF is now possible, but switch drivers will still need some > modifications to properly support those, including, but not limited to using > the correct binding information. This will be submitted on top of this series > > Russell, we could theoretically eliminate patch 3 and resolve this within DSA > entirely by keeping a per-port phy_interface_t (we did that before), this is > not a big change if we have to, let me know if you feel like this is cleaner. I > was initially considering passing a phylink_link_state reference to > mac_link_{up,down} but only a couple of fields are valid during link_down and > ended up with passing the phy_interface_t value we need instead. This is > necessary for switch drivers which have different types of port interfaces (see > bcm_sf2 documentation in tree). I think I will proceed differently for v2: - introduce DSA phylink_mac_ops in dsa_switch_ops, such that drivers can define those as preliminary commits, those won't be used by net/dsa/slave.c just yet though - have all relevant drivers implement phylink_mac_ops such that the pluming is there and functional - switch net/dsa/slave.c to using PHYLINK That way, we should avoid any breakage in between and have an "atomic" switch between PHYLIB and PHYLINK. > > Thank you! > > Florian Fainelli (4): > net: dsa: Eliminate dsa_slave_get_link() > net: phy: phylink: Provide PHY interface to mac_link_{up,down} > net: dsa: Plug in PHYLINK support > net: dsa: bcm_sf2: Implement phylink_mac_ops > > drivers/net/dsa/bcm_sf2.c | 190 +++++++++++++-------- > drivers/net/ethernet/marvell/mvneta.c | 4 +- > drivers/net/phy/phylink.c | 6 +- > include/linux/phylink.h | 10 +- > include/net/dsa.h | 27 ++- > net/dsa/Kconfig | 2 +- > net/dsa/dsa_priv.h | 9 - > net/dsa/slave.c | 304 ++++++++++++++++++++-------------- > 8 files changed, 340 insertions(+), 212 deletions(-) > -- Florian