From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antoine Tenart Subject: Re: [PATCH net-next v2 4/4] net: mvpp2: 2500baseX support Date: Wed, 3 Jan 2018 16:32:27 +0100 Message-ID: <20180103153227.GA9227@kwain> References: <20180103150750.12974-1-antoine.tenart@free-electrons.com> <20180103150750.12974-5-antoine.tenart@free-electrons.com> <20180103152036.GC3401@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Antoine Tenart , davem@davemloft.net, kishon@ti.com, gregory.clement@free-electrons.com, linux@armlinux.org.uk, mw@semihalf.com, stefanc@marvell.com, ymarkman@marvell.com, thomas.petazzoni@free-electrons.com, miquel.raynal@free-electrons.com, nadavh@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Andrew Lunn Return-path: Content-Disposition: inline In-Reply-To: <20180103152036.GC3401@lunn.ch> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Hi Andrew, On Wed, Jan 03, 2018 at 04:20:36PM +0100, Andrew Lunn wrote: > > @@ -4612,6 +4616,9 @@ static int mvpp22_comphy_init(struct mvpp2_port *port) > > case PHY_INTERFACE_MODE_1000BASEX: > > mode = PHY_MODE_SGMII; > > break; > > + case PHY_INTERFACE_MODE_2500BASEX: > > + mode = PHY_MODE_2500SGMII; > > + break; > > I think this is the source of confusion with linux/phy.h and > linux/phy/phy.h. > > What would PHY_INTERFACE_MODE_2500SGMII use? > > Where is this all getting confused? Should the caller to > mvpp22_comphy_init() actually be passing PHY_INTERFACE_MODE_2500SGMII? > What is the MAC actually doing at this point? 2500BASEX or 2500SGMII? PHY_INTERFACE_MODE_2500BASEX is the PHY mode whereas PHY_MODE_2500SGMII is the mode used by the common PHY driver (i.e. the one configuring the serdes lanes). There's no PHY_INTERFACE_MODE_2500SGMII mode. > At minimum there needs to be a comment that this is not a typ0, > otherwise you are going to get patches submitted to 'fix' this. Sure, I can add a comment to state this function is a translation between the net PHY mode and the generic PHY mode (it's a n-to-1 translation). Thanks! Antoine -- Antoine Ténart, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com