* [PATCH CFT 0/2] net: axienet: modernise pcs implementation @ 2021-12-16 12:47 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:47 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: David S. Miller, Jakub Kicinski, linux-arm-kernel, netdev, Sean Anderson Hi, These two patches modernise the Xilinx axienet PCS implementation to use the phylink split PCS support. The first patch adds split PCS support and makes use of the newly introduced mac_select_pcs() function, which is the preferred way to conditionally attach a PCS. The second patch cleans up the use of mdiobus_write() since we now have bus accessors for mdio devices. There should be no functional change to the driver. Please test, thanks. drivers/net/ethernet/xilinx/xilinx_axienet.h | 1 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 111 +++++++++++----------- 2 files changed, 56 insertions(+), 56 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH CFT 0/2] net: axienet: modernise pcs implementation @ 2021-12-16 12:47 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:47 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: David S. Miller, Jakub Kicinski, linux-arm-kernel, netdev, Sean Anderson Hi, These two patches modernise the Xilinx axienet PCS implementation to use the phylink split PCS support. The first patch adds split PCS support and makes use of the newly introduced mac_select_pcs() function, which is the preferred way to conditionally attach a PCS. The second patch cleans up the use of mdiobus_write() since we now have bus accessors for mdio devices. There should be no functional change to the driver. Please test, thanks. drivers/net/ethernet/xilinx/xilinx_axienet.h | 1 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 111 +++++++++++----------- 2 files changed, 56 insertions(+), 56 deletions(-) -- 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-16 12:47 ` Russell King (Oracle) @ 2021-12-16 12:48 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:48 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 1 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 112 +++++++++--------- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index 5b4d153b1492..81f09bd8f11c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -434,6 +434,7 @@ struct axienet_local { struct phylink_config phylink_config; struct mdio_device *pcs_phy; + struct phylink_pcs pcs; bool switch_x_sgmii; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 23ac353b35fe..5edc8ec72317 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1509,78 +1509,80 @@ static const struct ethtool_ops axienet_ethtool_ops = { .nway_reset = axienet_ethtools_nway_reset, }; -static void axienet_mac_pcs_get_state(struct phylink_config *config, - struct phylink_link_state *state) +static struct axienet_local *pcs_to_axienet_local(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + return container_of(pcs, struct axienet_local, pcs); +} - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - phylink_mii_c22_pcs_get_state(lp->pcs_phy, state); - break; - default: - break; - } +static void axienet_pcs_get_state(struct phylink_pcs *pcs, + struct phylink_link_state *state) +{ + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + + phylink_mii_c22_pcs_get_state(pcs_phy, state); } -static void axienet_mac_an_restart(struct phylink_config *config) +static void axienet_pcs_an_restart(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; - phylink_mii_c22_pcs_an_restart(lp->pcs_phy); + phylink_mii_c22_pcs_an_restart(pcs_phy); } -static int axienet_mac_prepare(struct phylink_config *config, unsigned int mode, - phy_interface_t iface) +static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, + phy_interface_t interface, + const unsigned long *advertising, + bool permit_pause_to_mac) { - struct net_device *ndev = to_net_dev(config->dev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + struct net_device *ndev = pcs_to_axienet_local(pcs)->ndev; struct axienet_local *lp = netdev_priv(ndev); int ret; - switch (iface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - if (!lp->switch_x_sgmii) - return 0; - - ret = mdiobus_write(lp->pcs_phy->bus, - lp->pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, - iface == 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; - default: + /* 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; } + + ret = phylink_mii_c22_pcs_config(pcs_phy, mode, interface, advertising); + if (ret < 0) + netdev_warn(ndev, "Failed to configure PCS: %d\n", ret); + + return ret; } -static void axienet_mac_config(struct phylink_config *config, unsigned int mode, - const struct phylink_link_state *state) +static const struct phylink_pcs_ops axienet_pcs_ops = { + .pcs_get_state = axienet_pcs_get_state, + .pcs_config = axienet_pcs_config, + .pcs_an_restart = axienet_pcs_an_restart, +}; + +static struct phylink_pcs *axienet_mac_select_pcs(struct phylink_config *config, + phy_interface_t interface) { struct net_device *ndev = to_net_dev(config->dev); struct axienet_local *lp = netdev_priv(ndev); - int ret; - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - ret = phylink_mii_c22_pcs_config(lp->pcs_phy, mode, - state->interface, - state->advertising); - if (ret < 0) - netdev_warn(ndev, "Failed to configure PCS: %d\n", - ret); - break; + if (interface == PHY_INTERFACE_MODE_1000BASEX || + interface == PHY_INTERFACE_MODE_SGMII) + return &lp->pcs; - default: - break; - } + return NULL; +} + +static void axienet_mac_config(struct phylink_config *config, unsigned int mode, + const struct phylink_link_state *state) +{ + /* nothing meaningful to do */ } static void axienet_mac_link_down(struct phylink_config *config, @@ -1635,9 +1637,7 @@ static void axienet_mac_link_up(struct phylink_config *config, static const struct phylink_mac_ops axienet_phylink_ops = { .validate = phylink_generic_validate, - .mac_pcs_get_state = axienet_mac_pcs_get_state, - .mac_an_restart = axienet_mac_an_restart, - .mac_prepare = axienet_mac_prepare, + .mac_select_pcs = axienet_mac_select_pcs, .mac_config = axienet_mac_config, .mac_link_down = axienet_mac_link_down, .mac_link_up = axienet_mac_link_up, @@ -2046,12 +2046,12 @@ static int axienet_probe(struct platform_device *pdev) ret = -EPROBE_DEFER; goto cleanup_mdio; } - lp->phylink_config.pcs_poll = true; + lp->pcs.ops = &axienet_pcs_ops; + lp->pcs.poll = true; } lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; - lp->phylink_config.legacy_pre_march2020 = true; lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10FD | MAC_100FD | MAC_1000FD; -- 2.30.2 ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2021-12-16 12:48 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:48 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 1 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 112 +++++++++--------- 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index 5b4d153b1492..81f09bd8f11c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -434,6 +434,7 @@ struct axienet_local { struct phylink_config phylink_config; struct mdio_device *pcs_phy; + struct phylink_pcs pcs; bool switch_x_sgmii; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 23ac353b35fe..5edc8ec72317 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1509,78 +1509,80 @@ static const struct ethtool_ops axienet_ethtool_ops = { .nway_reset = axienet_ethtools_nway_reset, }; -static void axienet_mac_pcs_get_state(struct phylink_config *config, - struct phylink_link_state *state) +static struct axienet_local *pcs_to_axienet_local(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + return container_of(pcs, struct axienet_local, pcs); +} - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - phylink_mii_c22_pcs_get_state(lp->pcs_phy, state); - break; - default: - break; - } +static void axienet_pcs_get_state(struct phylink_pcs *pcs, + struct phylink_link_state *state) +{ + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + + phylink_mii_c22_pcs_get_state(pcs_phy, state); } -static void axienet_mac_an_restart(struct phylink_config *config) +static void axienet_pcs_an_restart(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; - phylink_mii_c22_pcs_an_restart(lp->pcs_phy); + phylink_mii_c22_pcs_an_restart(pcs_phy); } -static int axienet_mac_prepare(struct phylink_config *config, unsigned int mode, - phy_interface_t iface) +static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, + phy_interface_t interface, + const unsigned long *advertising, + bool permit_pause_to_mac) { - struct net_device *ndev = to_net_dev(config->dev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + struct net_device *ndev = pcs_to_axienet_local(pcs)->ndev; struct axienet_local *lp = netdev_priv(ndev); int ret; - switch (iface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - if (!lp->switch_x_sgmii) - return 0; - - ret = mdiobus_write(lp->pcs_phy->bus, - lp->pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, - iface == 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; - default: + /* 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; } + + ret = phylink_mii_c22_pcs_config(pcs_phy, mode, interface, advertising); + if (ret < 0) + netdev_warn(ndev, "Failed to configure PCS: %d\n", ret); + + return ret; } -static void axienet_mac_config(struct phylink_config *config, unsigned int mode, - const struct phylink_link_state *state) +static const struct phylink_pcs_ops axienet_pcs_ops = { + .pcs_get_state = axienet_pcs_get_state, + .pcs_config = axienet_pcs_config, + .pcs_an_restart = axienet_pcs_an_restart, +}; + +static struct phylink_pcs *axienet_mac_select_pcs(struct phylink_config *config, + phy_interface_t interface) { struct net_device *ndev = to_net_dev(config->dev); struct axienet_local *lp = netdev_priv(ndev); - int ret; - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - ret = phylink_mii_c22_pcs_config(lp->pcs_phy, mode, - state->interface, - state->advertising); - if (ret < 0) - netdev_warn(ndev, "Failed to configure PCS: %d\n", - ret); - break; + if (interface == PHY_INTERFACE_MODE_1000BASEX || + interface == PHY_INTERFACE_MODE_SGMII) + return &lp->pcs; - default: - break; - } + return NULL; +} + +static void axienet_mac_config(struct phylink_config *config, unsigned int mode, + const struct phylink_link_state *state) +{ + /* nothing meaningful to do */ } static void axienet_mac_link_down(struct phylink_config *config, @@ -1635,9 +1637,7 @@ static void axienet_mac_link_up(struct phylink_config *config, static const struct phylink_mac_ops axienet_phylink_ops = { .validate = phylink_generic_validate, - .mac_pcs_get_state = axienet_mac_pcs_get_state, - .mac_an_restart = axienet_mac_an_restart, - .mac_prepare = axienet_mac_prepare, + .mac_select_pcs = axienet_mac_select_pcs, .mac_config = axienet_mac_config, .mac_link_down = axienet_mac_link_down, .mac_link_up = axienet_mac_link_up, @@ -2046,12 +2046,12 @@ static int axienet_probe(struct platform_device *pdev) ret = -EPROBE_DEFER; goto cleanup_mdio; } - lp->phylink_config.pcs_poll = true; + lp->pcs.ops = &axienet_pcs_ops; + lp->pcs.poll = true; } lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; - lp->phylink_config.legacy_pre_march2020 = true; lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10FD | MAC_100FD | MAC_1000FD; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-16 12:48 ` Russell King (Oracle) @ 2021-12-16 15:15 ` Jakub Kicinski -1 siblings, 0 replies; 30+ messages in thread From: Jakub Kicinski @ 2021-12-16 15:15 UTC (permalink / raw) To: Russell King (Oracle) Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> drivers/net/ethernet/xilinx/xilinx_axienet.h:479: warning: Function parameter or member 'pcs' not described in 'axienet_local' ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2021-12-16 15:15 ` Jakub Kicinski 0 siblings, 0 replies; 30+ messages in thread From: Jakub Kicinski @ 2021-12-16 15:15 UTC (permalink / raw) To: Russell King (Oracle) Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> drivers/net/ethernet/xilinx/xilinx_axienet.h:479: warning: Function parameter or member 'pcs' not described in 'axienet_local' _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-16 15:15 ` Jakub Kicinski @ 2021-12-16 17:02 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 17:02 UTC (permalink / raw) To: Jakub Kicinski Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> > > 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! -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2021-12-16 17:02 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 17:02 UTC (permalink / raw) To: Jakub Kicinski Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel 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) <rmk+kernel@armlinux.org.uk> > > 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! -- 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-16 17:02 ` Russell King (Oracle) @ 2021-12-17 8:24 ` Radhey Shyam Pandey -1 siblings, 0 replies; 30+ messages in thread From: Radhey Shyam Pandey @ 2021-12-17 8:24 UTC (permalink / raw) To: Russell King, Jakub Kicinski Cc: Michal Simek, Sean Anderson, David S. Miller, netdev, linux-arm-kernel, Harini Katakam + Harini > -----Original Message----- > From: Russell King <linux@armlinux.org.uk> > Sent: Thursday, December 16, 2021 10:32 PM > To: Jakub Kicinski <kuba@kernel.org> > Cc: Michal Simek <michals@xilinx.com>; Radhey Shyam Pandey > <radheys@xilinx.com>; Sean Anderson <sean.anderson@seco.com>; David S. > Miller <davem@davemloft.net>; netdev@vger.kernel.org; linux-arm- > kernel@lists.infradead.org > Subject: Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs > > 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) <rmk+kernel@armlinux.org.uk> > > > > 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, series looks fine. I have added Harini to this thread and she will confirm it on hardware. > > Thanks! > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2021-12-17 8:24 ` Radhey Shyam Pandey 0 siblings, 0 replies; 30+ messages in thread From: Radhey Shyam Pandey @ 2021-12-17 8:24 UTC (permalink / raw) To: Russell King, Jakub Kicinski Cc: Michal Simek, Sean Anderson, David S. Miller, netdev, linux-arm-kernel, Harini Katakam + Harini > -----Original Message----- > From: Russell King <linux@armlinux.org.uk> > Sent: Thursday, December 16, 2021 10:32 PM > To: Jakub Kicinski <kuba@kernel.org> > Cc: Michal Simek <michals@xilinx.com>; Radhey Shyam Pandey > <radheys@xilinx.com>; Sean Anderson <sean.anderson@seco.com>; David S. > Miller <davem@davemloft.net>; netdev@vger.kernel.org; linux-arm- > kernel@lists.infradead.org > Subject: Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs > > 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) <rmk+kernel@armlinux.org.uk> > > > > 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, series looks fine. I have added Harini to this thread and she will confirm it on hardware. > > Thanks! > > -- > 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-16 17:02 ` Russell King (Oracle) @ 2021-12-17 8:25 ` Harini Katakam -1 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2021-12-17 8:25 UTC (permalink / raw) To: Russell King (Oracle) Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel Hi Russell, On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > 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. Regards, Harini ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2021-12-17 8:25 ` Harini Katakam 0 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2021-12-17 8:25 UTC (permalink / raw) To: Russell King (Oracle) Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel Hi Russell, On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > 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. Regards, Harini _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2021-12-17 8:25 ` Harini Katakam @ 2022-01-04 7:56 ` Harini Katakam -1 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2022-01-04 7:56 UTC (permalink / raw) To: Russell King (Oracle) Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Fri, Dec 17, 2021 at 1:55 PM Harini Katakam <harinik@xilinx.com> wrote: > > Hi Russell, > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > > > 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. Regards, Harini ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2022-01-04 7:56 ` Harini Katakam 0 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2022-01-04 7:56 UTC (permalink / raw) To: Russell King (Oracle) Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Fri, Dec 17, 2021 at 1:55 PM Harini Katakam <harinik@xilinx.com> wrote: > > Hi Russell, > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > > > 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. Regards, Harini _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2022-01-04 7:56 ` Harini Katakam @ 2022-01-04 9:00 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 9:00 UTC (permalink / raw) To: Harini Katakam Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Tue, Jan 04, 2022 at 01:26:28PM +0530, Harini Katakam wrote: > On Fri, Dec 17, 2021 at 1:55 PM Harini Katakam <harinik@xilinx.com> wrote: > > > > Hi Russell, > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > > > > > 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? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2022-01-04 9:00 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 9:00 UTC (permalink / raw) To: Harini Katakam Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Tue, Jan 04, 2022 at 01:26:28PM +0530, Harini Katakam wrote: > On Fri, Dec 17, 2021 at 1:55 PM Harini Katakam <harinik@xilinx.com> wrote: > > > > Hi Russell, > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > <linux@armlinux.org.uk> 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) <rmk+kernel@armlinux.org.uk> > > > > > > > > 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? -- 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2022-01-04 9:00 ` Russell King (Oracle) @ 2022-01-04 9:12 ` Harini Katakam -1 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2022-01-04 9:12 UTC (permalink / raw) To: Russell King Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel > -----Original Message----- > From: Russell King <linux@armlinux.org.uk> > Sent: Tuesday, January 4, 2022 2:31 PM > To: Harini Katakam <harinik@xilinx.com> > Cc: Jakub Kicinski <kuba@kernel.org>; Michal Simek <michals@xilinx.com>; > Radhey Shyam Pandey <radheys@xilinx.com>; Sean Anderson > <sean.anderson@seco.com>; David S. Miller <davem@davemloft.net>; > netdev <netdev@vger.kernel.org>; linux-arm-kernel@lists.infradead.org > 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 <harinik@xilinx.com> wrote: > > > > > > Hi Russell, > > > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > > <linux@armlinux.org.uk> 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) > > > > > > <rmk+kernel@armlinux.org.uk> > > > > > > > > > > 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 <harini.katakam@xilinx.com> Happy new year to you too! Regards, Harini ^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2022-01-04 9:12 ` Harini Katakam 0 siblings, 0 replies; 30+ messages in thread From: Harini Katakam @ 2022-01-04 9:12 UTC (permalink / raw) To: Russell King Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel > -----Original Message----- > From: Russell King <linux@armlinux.org.uk> > Sent: Tuesday, January 4, 2022 2:31 PM > To: Harini Katakam <harinik@xilinx.com> > Cc: Jakub Kicinski <kuba@kernel.org>; Michal Simek <michals@xilinx.com>; > Radhey Shyam Pandey <radheys@xilinx.com>; Sean Anderson > <sean.anderson@seco.com>; David S. Miller <davem@davemloft.net>; > netdev <netdev@vger.kernel.org>; linux-arm-kernel@lists.infradead.org > 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 <harinik@xilinx.com> wrote: > > > > > > Hi Russell, > > > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > > <linux@armlinux.org.uk> 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) > > > > > > <rmk+kernel@armlinux.org.uk> > > > > > > > > > > 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 <harini.katakam@xilinx.com> Happy new year to you too! Regards, Harini _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs 2022-01-04 9:12 ` Harini Katakam @ 2022-01-04 10:34 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:34 UTC (permalink / raw) To: Harini Katakam Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Tue, Jan 04, 2022 at 09:12:06AM +0000, Harini Katakam wrote: > > -----Original Message----- > > From: Russell King <linux@armlinux.org.uk> > > Sent: Tuesday, January 4, 2022 2:31 PM > > To: Harini Katakam <harinik@xilinx.com> > > Cc: Jakub Kicinski <kuba@kernel.org>; Michal Simek <michals@xilinx.com>; > > Radhey Shyam Pandey <radheys@xilinx.com>; Sean Anderson > > <sean.anderson@seco.com>; David S. Miller <davem@davemloft.net>; > > netdev <netdev@vger.kernel.org>; linux-arm-kernel@lists.infradead.org > > 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 <harinik@xilinx.com> wrote: > > > > > > > > Hi Russell, > > > > > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > > > <linux@armlinux.org.uk> 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) > > > > > > > <rmk+kernel@armlinux.org.uk> > > > > > > > > > > > > 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 <harini.katakam@xilinx.com> > > 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! ^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs @ 2022-01-04 10:34 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:34 UTC (permalink / raw) To: Harini Katakam Cc: Jakub Kicinski, Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Tue, Jan 04, 2022 at 09:12:06AM +0000, Harini Katakam wrote: > > -----Original Message----- > > From: Russell King <linux@armlinux.org.uk> > > Sent: Tuesday, January 4, 2022 2:31 PM > > To: Harini Katakam <harinik@xilinx.com> > > Cc: Jakub Kicinski <kuba@kernel.org>; Michal Simek <michals@xilinx.com>; > > Radhey Shyam Pandey <radheys@xilinx.com>; Sean Anderson > > <sean.anderson@seco.com>; David S. Miller <davem@davemloft.net>; > > netdev <netdev@vger.kernel.org>; linux-arm-kernel@lists.infradead.org > > 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 <harinik@xilinx.com> wrote: > > > > > > > > Hi Russell, > > > > > > > > On Fri, Dec 17, 2021 at 5:26 AM Russell King (Oracle) > > > > <linux@armlinux.org.uk> 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) > > > > > > > <rmk+kernel@armlinux.org.uk> > > > > > > > > > > > > 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 <harini.katakam@xilinx.com> > > 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() 2021-12-16 12:47 ` Russell King (Oracle) @ 2021-12-16 12:48 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:48 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Commit 197a68ef1837 ("net: mdio: Add helper functions for accessing MDIO devices") added support for mdiodev accessor operations that neatly wrap the mdiobus accessor operations. Since we are dealing with a mdio device here, update the driver to use mdiodev_write(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 5edc8ec72317..ac23d1c65ac8 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1543,8 +1543,7 @@ static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, if (!lp->switch_x_sgmii) return 0; - ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, + ret = mdiodev_write(pcs_phy, XLNX_MII_STD_SELECT_REG, interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); if (ret < 0) { -- 2.30.2 ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() @ 2021-12-16 12:48 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2021-12-16 12:48 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Commit 197a68ef1837 ("net: mdio: Add helper functions for accessing MDIO devices") added support for mdiodev accessor operations that neatly wrap the mdiobus accessor operations. Since we are dealing with a mdio device here, update the driver to use mdiodev_write(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 5edc8ec72317..ac23d1c65ac8 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1543,8 +1543,7 @@ static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, if (!lp->switch_x_sgmii) return 0; - ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, + ret = mdiodev_write(pcs_phy, XLNX_MII_STD_SELECT_REG, interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); if (ret < 0) { -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() 2021-12-16 12:48 ` Russell King (Oracle) @ 2021-12-16 15:14 ` Jakub Kicinski -1 siblings, 0 replies; 30+ messages in thread From: Jakub Kicinski @ 2021-12-16 15:14 UTC (permalink / raw) To: Russell King (Oracle) Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Thu, 16 Dec 2021 12:48:50 +0000 Russell King (Oracle) wrote: > Commit 197a68ef1837 ("net: mdio: Add helper functions for accessing > MDIO devices") added support for mdiodev accessor operations that Nit: wrong commit id, 0ebecb2644c8 ("net: mdio: Add helper functions for accessing MDIO devices")? ^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH CFT net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() @ 2021-12-16 15:14 ` Jakub Kicinski 0 siblings, 0 replies; 30+ messages in thread From: Jakub Kicinski @ 2021-12-16 15:14 UTC (permalink / raw) To: Russell King (Oracle) Cc: Michal Simek, Radhey Shyam Pandey, Sean Anderson, David S. Miller, netdev, linux-arm-kernel On Thu, 16 Dec 2021 12:48:50 +0000 Russell King (Oracle) wrote: > Commit 197a68ef1837 ("net: mdio: Add helper functions for accessing > MDIO devices") added support for mdiodev accessor operations that Nit: wrong commit id, 0ebecb2644c8 ("net: mdio: Add helper functions for accessing MDIO devices")? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH CFT v2 0/2] net: axienet: modernise pcs implementation 2021-12-16 12:47 ` Russell King (Oracle) @ 2022-01-04 10:44 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:44 UTC (permalink / raw) To: Michal Simek, Harini Katakam, Radhey Shyam Pandey Cc: David S. Miller, Jakub Kicinski, linux-arm-kernel, netdev, Sean Anderson Hi, These two patches modernise the Xilinx axienet PCS implementation to use the phylink split PCS support. The first patch adds split PCS support and makes use of the newly introduced mac_select_pcs() function, which is the preferred way to conditionally attach a PCS. The second patch cleans up the use of mdiobus_write() since we now have bus accessors for mdio devices. There should be no functional change to the driver. Please test, thanks. v2: remove question over switch_x_sgmii drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 108 +++++++++++----------- 2 files changed, 55 insertions(+), 55 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH CFT v2 0/2] net: axienet: modernise pcs implementation @ 2022-01-04 10:44 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:44 UTC (permalink / raw) To: Michal Simek, Harini Katakam, Radhey Shyam Pandey Cc: David S. Miller, Jakub Kicinski, linux-arm-kernel, netdev, Sean Anderson Hi, These two patches modernise the Xilinx axienet PCS implementation to use the phylink split PCS support. The first patch adds split PCS support and makes use of the newly introduced mac_select_pcs() function, which is the preferred way to conditionally attach a PCS. The second patch cleans up the use of mdiobus_write() since we now have bus accessors for mdio devices. There should be no functional change to the driver. Please test, thanks. v2: remove question over switch_x_sgmii drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 108 +++++++++++----------- 2 files changed, 55 insertions(+), 55 deletions(-) -- 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 linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH CFT v2 net-next 1/2] net: axienet: convert to phylink_pcs 2022-01-04 10:44 ` Russell King (Oracle) @ 2022-01-04 10:46 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:46 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey, Harini Katakam Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Convert axienet to use the phylink_pcs layer, resulting in it no longer being a legacy driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 107 +++++++++--------- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index 5b4d153b1492..40108968b350 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -386,6 +386,7 @@ struct axidma_bd { * @phylink: Pointer to phylink instance * @phylink_config: phylink configuration settings * @pcs_phy: Reference to PCS/PMA PHY if used + * @pcs: phylink pcs structure for PCS PHY * @switch_x_sgmii: Whether switchable 1000BaseX/SGMII mode is enabled in the core * @axi_clk: AXI4-Lite bus clock * @misc_clks: Misc ethernet clocks (AXI4-Stream, Ref, MGT clocks) @@ -434,6 +435,7 @@ struct axienet_local { struct phylink_config phylink_config; struct mdio_device *pcs_phy; + struct phylink_pcs pcs; bool switch_x_sgmii; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 23ac353b35fe..7a28355114a8 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1509,78 +1509,79 @@ static const struct ethtool_ops axienet_ethtool_ops = { .nway_reset = axienet_ethtools_nway_reset, }; -static void axienet_mac_pcs_get_state(struct phylink_config *config, - struct phylink_link_state *state) +static struct axienet_local *pcs_to_axienet_local(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + return container_of(pcs, struct axienet_local, pcs); +} - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - phylink_mii_c22_pcs_get_state(lp->pcs_phy, state); - break; - default: - break; - } +static void axienet_pcs_get_state(struct phylink_pcs *pcs, + struct phylink_link_state *state) +{ + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + + phylink_mii_c22_pcs_get_state(pcs_phy, state); } -static void axienet_mac_an_restart(struct phylink_config *config) +static void axienet_pcs_an_restart(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; - phylink_mii_c22_pcs_an_restart(lp->pcs_phy); + phylink_mii_c22_pcs_an_restart(pcs_phy); } -static int axienet_mac_prepare(struct phylink_config *config, unsigned int mode, - phy_interface_t iface) +static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, + phy_interface_t interface, + const unsigned long *advertising, + bool permit_pause_to_mac) { - struct net_device *ndev = to_net_dev(config->dev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + struct net_device *ndev = pcs_to_axienet_local(pcs)->ndev; struct axienet_local *lp = netdev_priv(ndev); int ret; - switch (iface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - if (!lp->switch_x_sgmii) - return 0; - - ret = mdiobus_write(lp->pcs_phy->bus, - lp->pcs_phy->addr, + if (lp->switch_x_sgmii) { + ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, XLNX_MII_STD_SELECT_REG, - iface == PHY_INTERFACE_MODE_SGMII ? + interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); - if (ret < 0) - netdev_warn(ndev, "Failed to switch PHY interface: %d\n", + if (ret < 0) { + netdev_warn(ndev, + "Failed to switch PHY interface: %d\n", ret); - return ret; - default: - return 0; + return ret; + } } + + ret = phylink_mii_c22_pcs_config(pcs_phy, mode, interface, advertising); + if (ret < 0) + netdev_warn(ndev, "Failed to configure PCS: %d\n", ret); + + return ret; } -static void axienet_mac_config(struct phylink_config *config, unsigned int mode, - const struct phylink_link_state *state) +static const struct phylink_pcs_ops axienet_pcs_ops = { + .pcs_get_state = axienet_pcs_get_state, + .pcs_config = axienet_pcs_config, + .pcs_an_restart = axienet_pcs_an_restart, +}; + +static struct phylink_pcs *axienet_mac_select_pcs(struct phylink_config *config, + phy_interface_t interface) { struct net_device *ndev = to_net_dev(config->dev); struct axienet_local *lp = netdev_priv(ndev); - int ret; - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - ret = phylink_mii_c22_pcs_config(lp->pcs_phy, mode, - state->interface, - state->advertising); - if (ret < 0) - netdev_warn(ndev, "Failed to configure PCS: %d\n", - ret); - break; + if (interface == PHY_INTERFACE_MODE_1000BASEX || + interface == PHY_INTERFACE_MODE_SGMII) + return &lp->pcs; - default: - break; - } + return NULL; +} + +static void axienet_mac_config(struct phylink_config *config, unsigned int mode, + const struct phylink_link_state *state) +{ + /* nothing meaningful to do */ } static void axienet_mac_link_down(struct phylink_config *config, @@ -1635,9 +1636,7 @@ static void axienet_mac_link_up(struct phylink_config *config, static const struct phylink_mac_ops axienet_phylink_ops = { .validate = phylink_generic_validate, - .mac_pcs_get_state = axienet_mac_pcs_get_state, - .mac_an_restart = axienet_mac_an_restart, - .mac_prepare = axienet_mac_prepare, + .mac_select_pcs = axienet_mac_select_pcs, .mac_config = axienet_mac_config, .mac_link_down = axienet_mac_link_down, .mac_link_up = axienet_mac_link_up, @@ -2046,12 +2045,12 @@ static int axienet_probe(struct platform_device *pdev) ret = -EPROBE_DEFER; goto cleanup_mdio; } - lp->phylink_config.pcs_poll = true; + lp->pcs.ops = &axienet_pcs_ops; + lp->pcs.poll = true; } lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; - lp->phylink_config.legacy_pre_march2020 = true; lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10FD | MAC_100FD | MAC_1000FD; -- 2.30.2 ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT v2 net-next 1/2] net: axienet: convert to phylink_pcs @ 2022-01-04 10:46 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:46 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey, Harini Katakam Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Convert axienet to use the phylink_pcs layer, resulting in it no longer being a legacy driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 + .../net/ethernet/xilinx/xilinx_axienet_main.c | 107 +++++++++--------- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index 5b4d153b1492..40108968b350 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -386,6 +386,7 @@ struct axidma_bd { * @phylink: Pointer to phylink instance * @phylink_config: phylink configuration settings * @pcs_phy: Reference to PCS/PMA PHY if used + * @pcs: phylink pcs structure for PCS PHY * @switch_x_sgmii: Whether switchable 1000BaseX/SGMII mode is enabled in the core * @axi_clk: AXI4-Lite bus clock * @misc_clks: Misc ethernet clocks (AXI4-Stream, Ref, MGT clocks) @@ -434,6 +435,7 @@ struct axienet_local { struct phylink_config phylink_config; struct mdio_device *pcs_phy; + struct phylink_pcs pcs; bool switch_x_sgmii; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 23ac353b35fe..7a28355114a8 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1509,78 +1509,79 @@ static const struct ethtool_ops axienet_ethtool_ops = { .nway_reset = axienet_ethtools_nway_reset, }; -static void axienet_mac_pcs_get_state(struct phylink_config *config, - struct phylink_link_state *state) +static struct axienet_local *pcs_to_axienet_local(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + return container_of(pcs, struct axienet_local, pcs); +} - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - phylink_mii_c22_pcs_get_state(lp->pcs_phy, state); - break; - default: - break; - } +static void axienet_pcs_get_state(struct phylink_pcs *pcs, + struct phylink_link_state *state) +{ + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + + phylink_mii_c22_pcs_get_state(pcs_phy, state); } -static void axienet_mac_an_restart(struct phylink_config *config) +static void axienet_pcs_an_restart(struct phylink_pcs *pcs) { - struct net_device *ndev = to_net_dev(config->dev); - struct axienet_local *lp = netdev_priv(ndev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; - phylink_mii_c22_pcs_an_restart(lp->pcs_phy); + phylink_mii_c22_pcs_an_restart(pcs_phy); } -static int axienet_mac_prepare(struct phylink_config *config, unsigned int mode, - phy_interface_t iface) +static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, + phy_interface_t interface, + const unsigned long *advertising, + bool permit_pause_to_mac) { - struct net_device *ndev = to_net_dev(config->dev); + struct mdio_device *pcs_phy = pcs_to_axienet_local(pcs)->pcs_phy; + struct net_device *ndev = pcs_to_axienet_local(pcs)->ndev; struct axienet_local *lp = netdev_priv(ndev); int ret; - switch (iface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - if (!lp->switch_x_sgmii) - return 0; - - ret = mdiobus_write(lp->pcs_phy->bus, - lp->pcs_phy->addr, + if (lp->switch_x_sgmii) { + ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, XLNX_MII_STD_SELECT_REG, - iface == PHY_INTERFACE_MODE_SGMII ? + interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); - if (ret < 0) - netdev_warn(ndev, "Failed to switch PHY interface: %d\n", + if (ret < 0) { + netdev_warn(ndev, + "Failed to switch PHY interface: %d\n", ret); - return ret; - default: - return 0; + return ret; + } } + + ret = phylink_mii_c22_pcs_config(pcs_phy, mode, interface, advertising); + if (ret < 0) + netdev_warn(ndev, "Failed to configure PCS: %d\n", ret); + + return ret; } -static void axienet_mac_config(struct phylink_config *config, unsigned int mode, - const struct phylink_link_state *state) +static const struct phylink_pcs_ops axienet_pcs_ops = { + .pcs_get_state = axienet_pcs_get_state, + .pcs_config = axienet_pcs_config, + .pcs_an_restart = axienet_pcs_an_restart, +}; + +static struct phylink_pcs *axienet_mac_select_pcs(struct phylink_config *config, + phy_interface_t interface) { struct net_device *ndev = to_net_dev(config->dev); struct axienet_local *lp = netdev_priv(ndev); - int ret; - switch (state->interface) { - case PHY_INTERFACE_MODE_SGMII: - case PHY_INTERFACE_MODE_1000BASEX: - ret = phylink_mii_c22_pcs_config(lp->pcs_phy, mode, - state->interface, - state->advertising); - if (ret < 0) - netdev_warn(ndev, "Failed to configure PCS: %d\n", - ret); - break; + if (interface == PHY_INTERFACE_MODE_1000BASEX || + interface == PHY_INTERFACE_MODE_SGMII) + return &lp->pcs; - default: - break; - } + return NULL; +} + +static void axienet_mac_config(struct phylink_config *config, unsigned int mode, + const struct phylink_link_state *state) +{ + /* nothing meaningful to do */ } static void axienet_mac_link_down(struct phylink_config *config, @@ -1635,9 +1636,7 @@ static void axienet_mac_link_up(struct phylink_config *config, static const struct phylink_mac_ops axienet_phylink_ops = { .validate = phylink_generic_validate, - .mac_pcs_get_state = axienet_mac_pcs_get_state, - .mac_an_restart = axienet_mac_an_restart, - .mac_prepare = axienet_mac_prepare, + .mac_select_pcs = axienet_mac_select_pcs, .mac_config = axienet_mac_config, .mac_link_down = axienet_mac_link_down, .mac_link_up = axienet_mac_link_up, @@ -2046,12 +2045,12 @@ static int axienet_probe(struct platform_device *pdev) ret = -EPROBE_DEFER; goto cleanup_mdio; } - lp->phylink_config.pcs_poll = true; + lp->pcs.ops = &axienet_pcs_ops; + lp->pcs.poll = true; } lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; - lp->phylink_config.legacy_pre_march2020 = true; lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10FD | MAC_100FD | MAC_1000FD; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT v2 net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() 2022-01-04 10:44 ` Russell King (Oracle) @ 2022-01-04 10:46 ` Russell King (Oracle) -1 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:46 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey, Harini Katakam Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Commit 0ebecb2644c8 ("net: mdio: Add helper functions for accessing MDIO devices") added support for mdiodev accessor operations that neatly wrap the mdiobus accessor operations. Since we are dealing with a mdio device here, update the driver to use mdiodev_write(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 7a28355114a8..42ffa8500c2b 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1540,8 +1540,7 @@ static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, int ret; if (lp->switch_x_sgmii) { - ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, + ret = mdiodev_write(pcs_phy, XLNX_MII_STD_SELECT_REG, interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); if (ret < 0) { -- 2.30.2 ^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH CFT v2 net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() @ 2022-01-04 10:46 ` Russell King (Oracle) 0 siblings, 0 replies; 30+ messages in thread From: Russell King (Oracle) @ 2022-01-04 10:46 UTC (permalink / raw) To: Michal Simek, Radhey Shyam Pandey, Harini Katakam Cc: Sean Anderson, David S. Miller, Jakub Kicinski, netdev, linux-arm-kernel Commit 0ebecb2644c8 ("net: mdio: Add helper functions for accessing MDIO devices") added support for mdiodev accessor operations that neatly wrap the mdiobus accessor operations. Since we are dealing with a mdio device here, update the driver to use mdiodev_write(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 7a28355114a8..42ffa8500c2b 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1540,8 +1540,7 @@ static int axienet_pcs_config(struct phylink_pcs *pcs, unsigned int mode, int ret; if (lp->switch_x_sgmii) { - ret = mdiobus_write(pcs_phy->bus, pcs_phy->addr, - XLNX_MII_STD_SELECT_REG, + ret = mdiodev_write(pcs_phy, XLNX_MII_STD_SELECT_REG, interface == PHY_INTERFACE_MODE_SGMII ? XLNX_MII_STD_SELECT_SGMII : 0); if (ret < 0) { -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 30+ messages in thread
end of thread, other threads:[~2022-01-04 10:50 UTC | newest] Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-12-16 12:47 [PATCH CFT 0/2] net: axienet: modernise pcs implementation Russell King (Oracle) 2021-12-16 12:47 ` Russell King (Oracle) 2021-12-16 12:48 ` [PATCH CFT net-next 1/2] net: axienet: convert to phylink_pcs Russell King (Oracle) 2021-12-16 12:48 ` Russell King (Oracle) 2021-12-16 15:15 ` Jakub Kicinski 2021-12-16 15:15 ` Jakub Kicinski 2021-12-16 17:02 ` Russell King (Oracle) 2021-12-16 17:02 ` Russell King (Oracle) 2021-12-17 8:24 ` Radhey Shyam Pandey 2021-12-17 8:24 ` Radhey Shyam Pandey 2021-12-17 8:25 ` Harini Katakam 2021-12-17 8:25 ` Harini Katakam 2022-01-04 7:56 ` Harini Katakam 2022-01-04 7:56 ` Harini Katakam 2022-01-04 9:00 ` Russell King (Oracle) 2022-01-04 9:00 ` Russell King (Oracle) 2022-01-04 9:12 ` Harini Katakam 2022-01-04 9:12 ` Harini Katakam 2022-01-04 10:34 ` Russell King (Oracle) 2022-01-04 10:34 ` Russell King (Oracle) 2021-12-16 12:48 ` [PATCH CFT net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() Russell King (Oracle) 2021-12-16 12:48 ` Russell King (Oracle) 2021-12-16 15:14 ` Jakub Kicinski 2021-12-16 15:14 ` Jakub Kicinski 2022-01-04 10:44 ` [PATCH CFT v2 0/2] net: axienet: modernise pcs implementation Russell King (Oracle) 2022-01-04 10:44 ` Russell King (Oracle) 2022-01-04 10:46 ` [PATCH CFT v2 net-next 1/2] net: axienet: convert to phylink_pcs Russell King (Oracle) 2022-01-04 10:46 ` Russell King (Oracle) 2022-01-04 10:46 ` [PATCH CFT v2 net-next 2/2] net: axienet: replace mdiobus_write() with mdiodev_write() Russell King (Oracle) 2022-01-04 10:46 ` Russell King (Oracle)
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.