RE: [EXT] Re: [PATCH net-next v2 4/4] net: mvpp2: 2500baseX support
From: Stefan Chulski <hidden>
Date: 2018-01-03 15:50:59
Also in:
lkml
-----Original Message----- From: Antoine Tenart [mailto:antoine.tenart@free-electrons.com] Sent: Wednesday, January 03, 2018 5:32 PM To: Andrew Lunn <andrew@lunn.ch> Cc: Antoine Tenart <redacted>; davem@davemloft.net; kishon@ti.com; gregory.clement@free-electrons.com; linux@armlinux.org.uk; mw@semihalf.com; Stefan Chulski [off-list ref]; Yan Markman [off-list ref]; thomas.petazzoni@free-electrons.com; miquel.raynal@free-electrons.com; Nadav Haklai [off-list ref]; netdev@vger.kernel.org; linux- kernel@vger.kernel.org Subject: [EXT] Re: [PATCH net-next v2 4/4] net: mvpp2: 2500baseX support External Email ---------------------------------------------------------------------- Hi Andrew, On Wed, Jan 03, 2018 at 04:20:36PM +0100, Andrew Lunn wrote:quoted
quoted
@@ -4612,6 +4616,9 @@ static int mvpp22_comphy_init(structmvpp2_port *port)quoted
quoted
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 passingPHY_INTERFACE_MODE_2500SGMII?quoted
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.quoted
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).
Maybe we should rename enum phy_mode to comphy_mode and PHY_MODE_2500SGMII to COMPHY_MODE_2500SGMII. Since this enum set MAC to PHY serdes communication mode, not PHY to PHY communication mode. Stefan.