Subject: Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs

From: "Russell King (Oracle)" <[email-masked]>
Date: Tue, 4 Jan 2022 10:34:31 +0000

On Tue, Jan 04, 2022 at 09:12:06AM +0000, Harini Katakam wrote:
> > -----Original Message-----
> > From: Russell King <[email-masked]>
> > Sent: Tuesday, January 4, 2022 2:31 PM
> > To: Harini Katakam <[email-masked]>
> > Cc: Jakub Kicinski <[email-masked]>; Michal Simek <[email-masked]>;
> > Radhey Shyam Pandey <[email-masked]>; Sean Anderson
> > <[email-masked]>; David S. Miller <[email-masked]>;
> > netdev <[email-masked]>; [email-masked]
> > Subject: Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs
> > 
> > On Tue, Jan 04, 2022 at 01:26:28PM +0530, Harini Katakam wrote:
> > > On Fri, Dec 17, 2021 at 1:55 PM Harini Katakam <[email-masked]> wrote:
> > > >
> > > > Hi Russell,
> > > >
> > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle)
> > > > <[email-masked]> wrote:
> > > > >
> > > > > On Thu, Dec 16, 2021 at 07:15:13AM -0800, Jakub Kicinski wrote:
> > > > > > On Thu, 16 Dec 2021 12:48:45 +0000 Russell King (Oracle) wrote:
> > > > > > > Convert axienet to use the phylink_pcs layer, resulting in it
> > > > > > > no longer being a legacy driver.
> > > > > > >
> > > > > > > One oddity in this driver is that lp->switch_x_sgmii controls
> > > > > > > whether we support switching between SGMII and 1000baseX.
> > > > > > > However, when clear, this also blocks updating the 1000baseX
> > > > > > > advertisement, which it probably should not be doing.
> > > > > > > Nevertheless, this behaviour is preserved but a comment is added.
> > > > > > >
> > > > > > > Signed-off-by: Russell King (Oracle)
> > > > > > > <[email-masked]>
> > > > > >
> > > > > > drivers/net/ethernet/xilinx/xilinx_axienet.h:479: warning: Function
> > parameter or member 'pcs' not described in 'axienet_local'
> > > > >
> > > > > Fixed that and the sha1 issue you raised in patch 2. Since both
> > > > > are "documentation" issues, I won't send out replacement patches
> > > > > until I've heard they've been tested on hardware though.
> > > >
> > > > Thanks for the patches.
> > > > Series looks good and we're testing at our end; will get back to you
> > > > early next week.
> > >
> > > Thanks Russell. I've tested AXI Ethernet and it works fine.
> > 
> > Happy new year!
> > 
> > Thanks - can I use that as a tested-by please, and would you be happy for me
> > to send the patches for merging this week?
> 
> Sure, yes and yes.
> Tested-by: Harini Katakam <[email-masked]>
> 
> Happy new year to you too!

Thanks. While adding the attributation, I was reminded of this comment in
the commit message:

  One oddity in this driver is that lp->switch_x_sgmii controls whether
  we support switching between SGMII and 1000baseX. However, when clear,
  this also blocks updating the 1000baseX advertisement, which it
  probably should not be doing. Nevertheless, this behaviour is preserved
  but a comment is added.

went back to look at that, and realised that this was not the case at
all, so patch 1 introduces a behaviour that wasn't originally there.
I'll post an update, but essentially the change to patch 1 is:

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index a556f0215049..fbe0de4bc8dd 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1533,18 +1533,17 @@ static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
 	struct axienet_local *lp = netdev_priv(ndev);
 	int ret;
 
-	/* We don't support changing the advertisement in 1000base-X? --rmk */
-	if (!lp->switch_x_sgmii)
-		return 0;
-
-	ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr,
-			    XLNX_MII_STD_SELECT_REG,
-			    interface == PHY_INTERFACE_MODE_SGMII ?
-				XLNX_MII_STD_SELECT_SGMII : 0);
-	if (ret < 0) {
-		netdev_warn(ndev, "Failed to switch PHY interface: %d\n",
-			    ret);
-		return ret;
+	if (lp->switch_x_sgmii) {
+		ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr,
+				    XLNX_MII_STD_SELECT_REG,
+				    interface == PHY_INTERFACE_MODE_SGMII ?
+					XLNX_MII_STD_SELECT_SGMII : 0);
+		if (ret < 0) {
+			netdev_warn(ndev,
+				    "Failed to switch PHY interface: %d\n",
+				    ret);
+			return ret;
+		}
 	}
 
 	ret = phylink_mii_c22_pcs_config(pcs_phy, mode, interface, advertising);

and a corresponding change to patch 2 for the change in code formatting.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel