Skip to contentSkip to conversation

net: phy: Centralize auto-negotation restart

PATCH In review Florian Fainelli 7 participants 23 messages Nov 15, 2016 – Nov 17, 2016

Subsystems (15)
lore
Share & tools
lore
#3 lore raw

PATCH 2/15 net: nb8800: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/aurora/nb8800.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/net/ethernet/aurora/nb8800.c +1 -11
index b59aa3541270..07ff6492402a 100644
@@ -1037,16 +1037,6 @@ static const struct net_device_ops nb8800_netdev_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
-static int nb8800_nway_reset(struct net_device *dev)
-{
-	struct phy_device *phydev = dev->phydev;
-
-	if (!phydev)
-		return -ENODEV;
-
-	return genphy_restart_aneg(phydev);
-}
-
 static void nb8800_get_pauseparam(struct net_device *dev,
 				  struct ethtool_pauseparam *pp)
 {
@@ -1165,7 +1155,7 @@ static void nb8800_get_ethtool_stats(struct net_device *dev,
 }
 
 static const struct ethtool_ops nb8800_ethtool_ops = {
-	.nway_reset		= nb8800_nway_reset,
+	.nway_reset		= phy_ethtool_nway_reset,
 	.get_link		= ethtool_op_get_link,
 	.get_pauseparam		= nb8800_get_pauseparam,
 	.set_pauseparam		= nb8800_set_pauseparam,
Signature · 1 line
2.9.3
#4 lore raw

PATCH 3/15 net: bcm63xx_enet: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bcm63xx_enet.c +2 -5
index 5c7acef1de2e..a43ab90c051e 100644
@@ -1434,11 +1434,8 @@ static int bcm_enet_nway_reset(struct net_device *dev)
 	struct bcm_enet_priv *priv;
 
 	priv = netdev_priv(dev);
-	if (priv->has_phy) {
-		if (!dev->phydev)
-			return -ENODEV;
-		return genphy_restart_aneg(dev->phydev);
-	}
+	if (priv->has_phy)
+		return phy_ethtool_nway_reset(dev),
 
 	return -EOPNOTSUPP;
 }
Signature · 1 line
2.9.3
#7 lore raw

PATCH 4/15 net: mv643xx_eth: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +1 -9
index 81b08d71c0f8..5f62c3d70df9 100644
@@ -1639,14 +1639,6 @@ static void mv643xx_eth_get_drvinfo(struct net_device *dev,
 	strlcpy(drvinfo->bus_info, "platform", sizeof(drvinfo->bus_info));
 }
 
-static int mv643xx_eth_nway_reset(struct net_device *dev)
-{
-	if (!dev->phydev)
-		return -EINVAL;
-
-	return genphy_restart_aneg(dev->phydev);
-}
-
 static int
 mv643xx_eth_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 {
@@ -1770,7 +1762,7 @@ static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset)
 
 static const struct ethtool_ops mv643xx_eth_ethtool_ops = {
 	.get_drvinfo		= mv643xx_eth_get_drvinfo,
-	.nway_reset		= mv643xx_eth_nway_reset,
+	.nway_reset		= phy_ethtool_nway_reset,
 	.get_link		= ethtool_op_get_link,
 	.get_coalesce		= mv643xx_eth_get_coalesce,
 	.set_coalesce		= mv643xx_eth_set_coalesce,
Signature · 1 line
2.9.3
#9 lore raw

PATCH 5/15 net: smsc911x: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/smsc/smsc911x.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +1 -6
index cdb343f0c6e0..be09573c6ced 100644
@@ -1956,11 +1956,6 @@ static void smsc911x_ethtool_getdrvinfo(struct net_device *dev,
 		sizeof(info->bus_info));
 }
 
-static int smsc911x_ethtool_nwayreset(struct net_device *dev)
-{
-	return phy_start_aneg(dev->phydev);
-}
-
 static u32 smsc911x_ethtool_getmsglevel(struct net_device *dev)
 {
 	struct smsc911x_data *pdata = netdev_priv(dev);
@@ -2132,7 +2127,7 @@ static int smsc911x_ethtool_set_eeprom(struct net_device *dev,
 static const struct ethtool_ops smsc911x_ethtool_ops = {
 	.get_link = ethtool_op_get_link,
 	.get_drvinfo = smsc911x_ethtool_getdrvinfo,
-	.nway_reset = smsc911x_ethtool_nwayreset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_msglevel = smsc911x_ethtool_getmsglevel,
 	.set_msglevel = smsc911x_ethtool_setmsglevel,
 	.get_regs_len = smsc911x_ethtool_getregslen,
Signature · 1 line
2.9.3
#10 lore raw

PATCH 6/15 net: ethernet: smsc9420: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/smsc/smsc9420.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/ethernet/smsc/smsc9420.c +1 -9
index b7bfed4bc96b..3174aebb322f 100644
@@ -254,14 +254,6 @@ static void smsc9420_ethtool_set_msglevel(struct net_device *netdev, u32 data)
 	pd->msg_enable = data;
 }
 
-static int smsc9420_ethtool_nway_reset(struct net_device *netdev)
-{
-	if (!netdev->phydev)
-		return -ENODEV;
-
-	return phy_start_aneg(netdev->phydev);
-}
-
 static int smsc9420_ethtool_getregslen(struct net_device *dev)
 {
 	/* all smsc9420 registers plus all phy registers */
@@ -417,7 +409,7 @@ static const struct ethtool_ops smsc9420_ethtool_ops = {
 	.get_drvinfo = smsc9420_ethtool_get_drvinfo,
 	.get_msglevel = smsc9420_ethtool_get_msglevel,
 	.set_msglevel = smsc9420_ethtool_set_msglevel,
-	.nway_reset = smsc9420_ethtool_nway_reset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_link = ethtool_op_get_link,
 	.get_eeprom_len = smsc9420_ethtool_get_eeprom_len,
 	.get_eeprom = smsc9420_ethtool_get_eeprom,
Signature · 1 line
2.9.3
#11 lore raw

PATCH 7/15 net: ethernet: ll_temac: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -6
index a9bd665fd122..bcd7b76dde9f 100644
@@ -967,13 +967,8 @@ static const struct attribute_group temac_attr_group = {
 };
 
 /* ethtool support */
-static int temac_nway_reset(struct net_device *ndev)
-{
-	return phy_start_aneg(ndev->phydev);
-}
-
 static const struct ethtool_ops temac_ethtool_ops = {
-	.nway_reset = temac_nway_reset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_link = ethtool_op_get_link,
 	.get_ts_info = ethtool_op_get_ts_info,
 	.get_link_ksettings = phy_ethtool_get_link_ksettings,
Signature · 1 line
2.9.3
#12 lore raw

PATCH 8/15 net: ethernet: ixp4xx_eth: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/xscale/ixp4xx_eth.c +1 -6
index 07d862d90869..aee55c03def0 100644
@@ -1001,11 +1001,6 @@ static void ixp4xx_get_drvinfo(struct net_device *dev,
 	strlcpy(info->bus_info, "internal", sizeof(info->bus_info));
 }
 
-static int ixp4xx_nway_reset(struct net_device *dev)
-{
-	return phy_start_aneg(dev->phydev);
-}
-
 int ixp46x_phc_index = -1;
 EXPORT_SYMBOL_GPL(ixp46x_phc_index);
 
@@ -1037,7 +1032,7 @@ static int ixp4xx_get_ts_info(struct net_device *dev,
 
 static const struct ethtool_ops ixp4xx_ethtool_ops = {
 	.get_drvinfo = ixp4xx_get_drvinfo,
-	.nway_reset = ixp4xx_nway_reset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_link = ethtool_op_get_link,
 	.get_ts_info = ixp4xx_get_ts_info,
 	.get_link_ksettings = phy_ethtool_get_link_ksettings,
Signature · 1 line
2.9.3
#13 lore raw

PATCH 9/15 net: bcmgenet: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +1 -8
index 4464bc5db934..33638dc0e104 100644
@@ -971,13 +971,6 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_eee *e)
 	return phy_ethtool_set_eee(priv->phydev, e);
 }
 
-static int bcmgenet_nway_reset(struct net_device *dev)
-{
-	struct bcmgenet_priv *priv = netdev_priv(dev);
-
-	return genphy_restart_aneg(priv->phydev);
-}
-
 /* standard ethtool support functions. */
 static const struct ethtool_ops bcmgenet_ethtool_ops = {
 	.get_strings		= bcmgenet_get_strings,
@@ -991,7 +984,7 @@ static const struct ethtool_ops bcmgenet_ethtool_ops = {
 	.set_wol		= bcmgenet_set_wol,
 	.get_eee		= bcmgenet_get_eee,
 	.set_eee		= bcmgenet_set_eee,
-	.nway_reset		= bcmgenet_nway_reset,
+	.nway_reset		= phy_ethtool_nway_reset,
 	.get_coalesce		= bcmgenet_get_coalesce,
 	.set_coalesce		= bcmgenet_set_coalesce,
 	.get_link_ksettings	= bcmgenet_get_link_ksettings,
Signature · 1 line
2.9.3
#14 lore raw

PATCH 10/15 net: fs_enet: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +1 -6
index 44f50e168703..34843c155420 100644
@@ -807,11 +807,6 @@ static void fs_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 		regs->version = 0;
 }
 
-static int fs_nway_reset(struct net_device *dev)
-{
-	return 0;
-}
-
 static u32 fs_get_msglevel(struct net_device *dev)
 {
 	struct fs_enet_private *fep = netdev_priv(dev);
@@ -865,7 +860,7 @@ static int fs_set_tunable(struct net_device *dev,
 static const struct ethtool_ops fs_ethtool_ops = {
 	.get_drvinfo = fs_get_drvinfo,
 	.get_regs_len = fs_get_regs_len,
-	.nway_reset = fs_nway_reset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_link = ethtool_op_get_link,
 	.get_msglevel = fs_get_msglevel,
 	.set_msglevel = fs_set_msglevel,
Signature · 1 line
2.9.3
#15 lore raw

PATCH 11/15 net: fec: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/freescale/fec_main.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +1 -11
index 01aebc0084a9..1aabe4bcc8ea 100644
@@ -2344,16 +2344,6 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset)
 }
 #endif /* !defined(CONFIG_M5272) */
 
-static int fec_enet_nway_reset(struct net_device *dev)
-{
-	struct phy_device *phydev = dev->phydev;
-
-	if (!phydev)
-		return -ENODEV;
-
-	return genphy_restart_aneg(phydev);
-}
-
 /* ITR clock source is enet system clock (clk_ahb).
  * TCTT unit is cycle_ns * 64 cycle
  * So, the ICTT value = X us / (cycle_ns * 64)
@@ -2553,7 +2543,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = {
 	.get_drvinfo		= fec_enet_get_drvinfo,
 	.get_regs_len		= fec_enet_get_regs_len,
 	.get_regs		= fec_enet_get_regs,
-	.nway_reset		= fec_enet_nway_reset,
+	.nway_reset		= phy_ethtool_nway_reset,
 	.get_link		= ethtool_op_get_link,
 	.get_coalesce		= fec_enet_get_coalesce,
 	.set_coalesce		= fec_enet_set_coalesce,
Signature · 1 line
2.9.3
#17 lore raw

PATCH 13/15 net: ethernet: lantiq_etop: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/lantiq_etop.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/ethernet/lantiq_etop.c +1 -7
index 1a739d71f1c2..9d931373a9b9 100644
@@ -303,15 +303,9 @@ ltq_etop_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 }
 
-static int
-ltq_etop_nway_reset(struct net_device *dev)
-{
-	return phy_start_aneg(dev->phydev);
-}
-
 static const struct ethtool_ops ltq_etop_ethtool_ops = {
 	.get_drvinfo = ltq_etop_get_drvinfo,
-	.nway_reset = ltq_etop_nway_reset,
+	.nway_reset = phy_ethtool_nway_reset,
 	.get_link_ksettings = phy_ethtool_get_link_ksettings,
 	.set_link_ksettings = phy_ethtool_set_link_ksettings,
 };
Signature · 1 line
2.9.3
#19 lore raw

PATCH 14/15 net: usb: ax88172x: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/usb/ax88172a.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/usb/ax88172a.c +1 -9
index 49a3bc107d05..6308386b09df 100644
@@ -149,14 +149,6 @@ static const struct net_device_ops ax88172a_netdev_ops = {
 	.ndo_set_rx_mode        = asix_set_multicast,
 };
 
-static int ax88172a_nway_reset(struct net_device *net)
-{
-	if (!net->phydev)
-		return -ENODEV;
-
-	return phy_start_aneg(net->phydev);
-}
-
 static const struct ethtool_ops ax88172a_ethtool_ops = {
 	.get_drvinfo		= asix_get_drvinfo,
 	.get_link		= usbnet_get_link,
@@ -167,7 +159,7 @@ static const struct ethtool_ops ax88172a_ethtool_ops = {
 	.get_eeprom_len		= asix_get_eeprom_len,
 	.get_eeprom		= asix_get_eeprom,
 	.set_eeprom		= asix_set_eeprom,
-	.nway_reset		= ax88172a_nway_reset,
+	.nway_reset		= phy_ethtool_nway_reset,
 	.get_link_ksettings	= phy_ethtool_get_link_ksettings,
 	.set_link_ksettings	= phy_ethtool_set_link_ksettings,
 };
Signature · 1 line
2.9.3
#20 lore raw

PATCH 15/15 net: usb: lan78xx: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/usb/lan78xx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/usb/lan78xx.c +0 -4
index bcd9010c1f27..cf2857fa938f 100644
@@ -1447,11 +1447,6 @@ static u32 lan78xx_get_link(struct net_device *net)
 	return net->phydev->link;
 }
 
-static int lan78xx_nway_reset(struct net_device *net)
-{
-	return phy_start_aneg(net->phydev);
-}
#0 lore raw

cover net: phy: Centralize auto-negotation restart

Hi all,

This patch series centralizes how ethtool::nway_reset is implemented by providing a PHYLIB function which calls into genphy_restart_aneg().

All drivers below are converted to use this new helper function. Some other have specific requirements that make them not quite suitable for a straight forward conversion.

There is another patch series which implements ethtool::nway_reset using the helper function introduced that depends on this patch series.

Florian Fainelli (15):
net: phy: Add phy_ethtool_nway_reset
net: nb8800: Utilize phy_ethtool_nway_reset
net: bcm63xx_enet: Utilize phy_ethtool_nway_reset
net: mv643xx_eth: Utilize phy_ethtool_nway_reset
net: smsc911x: Utilize phy_ethtool_nway_reset
net: ethernet: smsc9420: Utilize phy_ethtool_nway_reset
net: ethernet: ll_temac: Utilize phy_ethtool_nway_reset
net: ethernet: ixp4xx_eth: Utilize phy_ethtool_nway_reset
net: bcmgenet: Utilize phy_ethtool_nway_reset
net: fs_enet: Utilize phy_ethtool_nway_reset
net: fec: Utilize phy_ethtool_nway_reset
net: ethernet: ucc: Utilize phy_ethtool_nway_reset
net: ethernet: lantiq_etop: Utilize phy_ethtool_nway_reset
net: usb: ax88172x: Utilize phy_ethtool_nway_reset
net: usb: lan78xx: Utilize phy_ethtool_nway_reset

 drivers/net/ethernet/aurora/nb8800.c                  | 12 +-----------
 drivers/net/ethernet/broadcom/bcm63xx_enet.c          |  7 ++-----
 drivers/net/ethernet/broadcom/genet/bcmgenet.c        |  9 +--------
 drivers/net/ethernet/freescale/fec_main.c             | 12 +-----------
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |  7 +------
 drivers/net/ethernet/freescale/ucc_geth_ethtool.c     |  9 +--------
 drivers/net/ethernet/lantiq_etop.c                    |  8 +-------
 drivers/net/ethernet/marvell/mv643xx_eth.c            | 10 +---------
 drivers/net/ethernet/smsc/smsc911x.c                  |  7 +------
 drivers/net/ethernet/smsc/smsc9420.c                  | 10 +---------
 drivers/net/ethernet/xilinx/ll_temac_main.c           |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c              |  7 +------
 drivers/net/phy/phy.c                                 | 11 +++++++++++
 drivers/net/usb/ax88172a.c                            | 10 +---------
 drivers/net/usb/lan78xx.c                             |  7 +------
 include/linux/phy.h                                   |  1 +
 16 files changed, 27 insertions(+), 107 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/15 net: phy: Add phy_ethtool_nway_reset

This function just calls into genphy_restart_aneg() to perform an autonegotation restart.

---
 drivers/net/phy/phy.c | 11 +++++++++++
 include/linux/phy.h   |  1 +
 2 files changed, 12 insertions(+)
drivers/net/phy/phy.c +11 -0
index e6dd222fddb1..73adbaa9ac86 100644
@@ -1441,3 +1441,14 @@ int phy_ethtool_set_link_ksettings(struct net_device *ndev,
 	return phy_ethtool_ksettings_set(phydev, cmd);
 }
 EXPORT_SYMBOL(phy_ethtool_set_link_ksettings);
+
+int phy_ethtool_nway_reset(struct net_device *ndev)
+{
+	struct phy_device *phydev = ndev->phydev;
+
+	if (!phydev)
+		return -ENODEV;
+
+	return genphy_restart_aneg(phydev);
+}
+EXPORT_SYMBOL(phy_ethtool_nway_reset);
include/linux/phy.h +1 -0
index 9880d73a2c3d..b9bd3b4f4ea1 100644
@@ -860,6 +860,7 @@ int phy_ethtool_get_link_ksettings(struct net_device *ndev,
 				   struct ethtool_link_ksettings *cmd);
 int phy_ethtool_set_link_ksettings(struct net_device *ndev,
 				   const struct ethtool_link_ksettings *cmd);
+int phy_ethtool_nway_reset(struct net_device *ndev);
 
 int __init mdio_bus_init(void);
 void mdio_bus_exit(void);
Signature · 1 line
2.9.3
#16 lore raw

PATCH 12/15 net: ethernet: ucc: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
---
 drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/net/ethernet/freescale/ucc_geth_ethtool.c +1 -8
index 812a968a78e9..8ba636f61b50 100644
@@ -332,13 +332,6 @@ static void uec_get_ethtool_stats(struct net_device *netdev,
 	}
 }
 
-static int uec_nway_reset(struct net_device *netdev)
-{
-	struct ucc_geth_private *ugeth = netdev_priv(netdev);
-
-	return phy_start_aneg(ugeth->phydev);
-}
-
 /* Report driver information */
 static void
 uec_get_drvinfo(struct net_device *netdev,
@@ -394,7 +387,7 @@ static const struct ethtool_ops uec_ethtool_ops = {
 	.get_regs               = uec_get_regs,
 	.get_msglevel           = uec_get_msglevel,
 	.set_msglevel           = uec_set_msglevel,
-	.nway_reset             = uec_nway_reset,
+	.nway_reset             = phy_ethtool_nway_reset,
 	.get_link               = ethtool_op_get_link,
 	.get_ringparam          = uec_get_ringparam,
 	.set_ringparam          = uec_set_ringparam,
Signature · 1 line
2.9.3
Acked-by on v1 15/15
#21 lore raw

RE: [PATCH 15/15] net: usb: lan78xx: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
Quoted 30 lines
---
 drivers/net/usb/lan78xx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/usb/lan78xx.c +1 -6
index bcd9010c1f27..cf2857fa938f 100644
@@ -1447,11 +1447,6 @@ static u32 lan78xx_get_link(struct net_device *net)
 	return net->phydev->link;
 }
 
-static int lan78xx_nway_reset(struct net_device *net)
-{
-	return phy_start_aneg(net->phydev);
-}
-
 static void lan78xx_get_drvinfo(struct net_device *net,
 				struct ethtool_drvinfo *info)
 {
@@ -1655,7 +1650,7 @@ static int lan78xx_set_pause(struct net_device
 *net,
 
 static const struct ethtool_ops lan78xx_ethtool_ops = {
 	.get_link	= lan78xx_get_link,
-	.nway_reset	= lan78xx_nway_reset,
+	.nway_reset	= phy_ethtool_nway_reset,
 	.get_drvinfo	= lan78xx_get_drvinfo,
 	.get_msglevel	= lan78xx_get_msglevel,
Quoted 3 lines

.set_msglevel = lan78xx_set_msglevel,
--
2.9.3

#5 lore raw

Re: [PATCH 03/15] net: bcm63xx_enet: Utilize phy_ethtool_nway_reset

In reply to Florian Fainelli
Quoted 1 line · Florian Fainelli

Each patch of your patch series should have a commit message.

You can add the missing commit messages with
git rebase -i HEAD~15
choosing reword.

Please, add a cover letter message describing the patch series using

git format-patch -ns --cover-letter HEAD~15..HEAD

and provide a summary in the 0/15 message.

The cover letter and all patches should be in one mails thhread. If you put all messages into one directory you can send the series as one mail thread with

git send-email <directory>

Quoted 23 lines
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bcm63xx_enet.c +2 -5
index 5c7acef1de2e..a43ab90c051e 100644
@@ -1434,11 +1434,8 @@ static int bcm_enet_nway_reset(struct net_device *dev)
 	struct bcm_enet_priv *priv;
 
 	priv = netdev_priv(dev);
-	if (priv->has_phy) {
-		if (!dev->phydev)
-			return -ENODEV;
-		return genphy_restart_aneg(dev->phydev);
-	}
+	if (priv->has_phy)
+		return phy_ethtool_nway_reset(dev),
 
 	return -EOPNOTSUPP;
 }
#6 lore raw

Re: [PATCH 03/15] net: bcm63xx_enet: Utilize phy_ethtool_nway_reset

Quoted 4 lines · Heinrich Schuchardt
Quoted 1 line · Florian Fainelli

Each patch of your patch series should have a commit message.

It's pretty obvious what this does, really.

Quoted 10 lines

You can add the missing commit messages with
git rebase -i HEAD~15
choosing reword.

Please, add a cover letter message describing the patch series using

git format-patch -ns --cover-letter HEAD~15..HEAD

and provide a summary in the 0/15 message.

I did:

https://www.mail-archive.com/netdev at vger.kernel.org/maillist.html

and that is also apparent from:

In-Reply-To: <[email protected]>
References: <[email protected]>

And what I also did is to intentionally make sure that for each patch, there would not be 50+ people CC'd, but just the relevant people for each driver, which is exactly how cc-cmd=scripts/get_maintainer.pl work, making my life simpler honestly.

It's not nearly my first patch submission, but I admit I have been semi intentionally lazy with this patch set considering the number of patches.

Anyway, enough time wasted on this.

Signature · 1 line
Florian
maintainer
#22 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Tue, 15 Nov 2016 10:06:29 -0800

Quoted 10 lines

This patch series centralizes how ethtool::nway_reset is implemented by providing a PHYLIB function which calls into genphy_restart_aneg().

All drivers below are converted to use this new helper function. Some other have specific requirements that make them not quite suitable for a straight forward conversion.

There is another patch series which implements ethtool::nway_reset using the helper function introduced that depends on this patch series.

Series applied, thanks Florian.

#2 lore raw

Re: [PATCH 01/15] net: phy: Add phy_ethtool_nway_reset

In reply to Florian Fainelli

Hi,

drivers/net/phy/phy.c int phy_ethtool_set_link_ksettings(struct net_device *ndev, · line 1453

Quoted 12 lines · Florian Fainelli

This function just calls into genphy_restart_aneg() to perform an autonegotation restart.

drivers/net/phy/phy.c +9 -0
+int phy_ethtool_nway_reset(struct net_device *ndev)
+{
+	struct phy_device *phydev = ndev->phydev;
+
+	if (!phydev)
+		return -ENODEV;
+
+	return genphy_restart_aneg(phydev);
+}

and then you're using this function as .nway_reset of all netdev drivers in question.

genphy_restart_aneg() deals directly with MII BMCR register:

int genphy_restart_aneg(struct phy_device *phydev)

{
        int ctl = phy_read(phydev, MII_BMCR);

        if (ctl < 0)
                return ctl;

        ctl |= BMCR_ANENABLE | BMCR_ANRESTART;

        /* Don't isolate the PHY if we're negotiating */
        ctl &= ~BMCR_ISOLATE;

        return phy_write(phydev, MII_BMCR, ctl);
}

Will the above work if the PHY is something special, e.g. a "fixed" connection, or some kind of fiber trx etc? Normally, the PHY driver could provide its own config_aneg().

Signature · 4 lines
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland