All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers
@ 2019-02-25 16:14 ` Maxime Chevallier
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King,
	linux-arm-kernel, Antoine Tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal

Recent work on C45 helpers by Heiner made the
genphy_c45_pma_read_abilities function generic enough to use as a
default .get_featutes implementation.

This series removes the remaining redundant code in
mv3310_get_features(), and makes the 2110 PHY use
genphy_c45_pma_read_abilities() directly, since it doesn't have the
issue with the wrong abilities being reported.

Maxime Chevallier (2):
  net: phy: marvell10g: Let genphy_c45_pma_read_abilities set Aneg bit
  net: phy: marvell10g: Use the generic C45 helper to read the 2110
    features

 drivers/net/phy/marvell10g.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

-- 
2.19.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers
@ 2019-02-25 16:14 ` Maxime Chevallier
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Andrew Lunn, Florian Fainelli, Antoine Tenart, netdev,
	gregory.clement, linux-kernel, Maxime Chevallier,
	thomas.petazzoni, miquel.raynal, Russell King, linux-arm-kernel,
	Heiner Kallweit

Recent work on C45 helpers by Heiner made the
genphy_c45_pma_read_abilities function generic enough to use as a
default .get_featutes implementation.

This series removes the remaining redundant code in
mv3310_get_features(), and makes the 2110 PHY use
genphy_c45_pma_read_abilities() directly, since it doesn't have the
issue with the wrong abilities being reported.

Maxime Chevallier (2):
  net: phy: marvell10g: Let genphy_c45_pma_read_abilities set Aneg bit
  net: phy: marvell10g: Use the generic C45 helper to read the 2110
    features

 drivers/net/phy/marvell10g.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

-- 
2.19.2


_______________________________________________
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] 8+ messages in thread

* [PATCH net-next 1/2] net: phy: marvell10g: Let genphy_c45_pma_read_abilities set Aneg bit
  2019-02-25 16:14 ` Maxime Chevallier
@ 2019-02-25 16:14   ` Maxime Chevallier
  -1 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King,
	linux-arm-kernel, Antoine Tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal

The genphy_c45_pma_read_abilities helper now sets the Autoneg ability
in phydev->supported according to what the AN MMD reports.

We therefore don't need to manually do that in mv3310_get_features().

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 580e91deadbc..ab71da55c1e0 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -268,16 +268,6 @@ static int mv3310_get_features(struct phy_device *phydev)
 {
 	int ret, val;
 
-	if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) {
-		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
-		if (val < 0)
-			return val;
-
-		if (val & MDIO_AN_STAT1_ABLE)
-			linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
-					 phydev->supported);
-	}
-
 	ret = genphy_c45_pma_read_abilities(phydev);
 	if (ret)
 		return ret;
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 1/2] net: phy: marvell10g: Let genphy_c45_pma_read_abilities set Aneg bit
@ 2019-02-25 16:14   ` Maxime Chevallier
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Andrew Lunn, Florian Fainelli, Antoine Tenart, netdev,
	gregory.clement, linux-kernel, Maxime Chevallier,
	thomas.petazzoni, miquel.raynal, Russell King, linux-arm-kernel,
	Heiner Kallweit

The genphy_c45_pma_read_abilities helper now sets the Autoneg ability
in phydev->supported according to what the AN MMD reports.

We therefore don't need to manually do that in mv3310_get_features().

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/marvell10g.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 580e91deadbc..ab71da55c1e0 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -268,16 +268,6 @@ static int mv3310_get_features(struct phy_device *phydev)
 {
 	int ret, val;
 
-	if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) {
-		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
-		if (val < 0)
-			return val;
-
-		if (val & MDIO_AN_STAT1_ABLE)
-			linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
-					 phydev->supported);
-	}
-
 	ret = genphy_c45_pma_read_abilities(phydev);
 	if (ret)
 		return ret;
-- 
2.19.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] 8+ messages in thread

* [PATCH net-next 2/2] net: phy: marvell10g: Use the generic C45 helper to read the 2110 features
  2019-02-25 16:14 ` Maxime Chevallier
@ 2019-02-25 16:14   ` Maxime Chevallier
  -1 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King,
	linux-arm-kernel, Antoine Tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal

Contrary to the 3310, the 2110 PHY correctly reports it's 2.5G/5G
abilities. We can therefore use the genphy_c45_pma_read_abilities helper
to build the list of features.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/marvell10g.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index ab71da55c1e0..79106e70010f 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -472,7 +472,7 @@ static struct phy_driver mv3310_drivers[] = {
 		.phy_id		= MARVELL_PHY_ID_88E2110,
 		.phy_id_mask	= MARVELL_PHY_ID_MASK,
 		.name		= "mv88x2110",
-		.features	= PHY_10GBIT_FEATURES,
+		.get_features	= genphy_c45_pma_read_abilities,
 		.probe		= mv3310_probe,
 		.soft_reset	= gen10g_no_soft_reset,
 		.config_init	= mv3310_config_init,
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-next 2/2] net: phy: marvell10g: Use the generic C45 helper to read the 2110 features
@ 2019-02-25 16:14   ` Maxime Chevallier
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2019-02-25 16:14 UTC (permalink / raw)
  To: davem
  Cc: Andrew Lunn, Florian Fainelli, Antoine Tenart, netdev,
	gregory.clement, linux-kernel, Maxime Chevallier,
	thomas.petazzoni, miquel.raynal, Russell King, linux-arm-kernel,
	Heiner Kallweit

Contrary to the 3310, the 2110 PHY correctly reports it's 2.5G/5G
abilities. We can therefore use the genphy_c45_pma_read_abilities helper
to build the list of features.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/marvell10g.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index ab71da55c1e0..79106e70010f 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -472,7 +472,7 @@ static struct phy_driver mv3310_drivers[] = {
 		.phy_id		= MARVELL_PHY_ID_88E2110,
 		.phy_id_mask	= MARVELL_PHY_ID_MASK,
 		.name		= "mv88x2110",
-		.features	= PHY_10GBIT_FEATURES,
+		.get_features	= genphy_c45_pma_read_abilities,
 		.probe		= mv3310_probe,
 		.soft_reset	= gen10g_no_soft_reset,
 		.config_init	= mv3310_config_init,
-- 
2.19.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] 8+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers
  2019-02-25 16:14 ` Maxime Chevallier
@ 2019-02-28  5:42   ` David Miller
  -1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-02-28  5:42 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: netdev, linux-kernel, andrew, f.fainelli, hkallweit1, linux,
	linux-arm-kernel, antoine.tenart, thomas.petazzoni,
	gregory.clement, miquel.raynal

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Mon, 25 Feb 2019 17:14:05 +0100

> Recent work on C45 helpers by Heiner made the
> genphy_c45_pma_read_abilities function generic enough to use as a
> default .get_featutes implementation.
> 
> This series removes the remaining redundant code in
> mv3310_get_features(), and makes the 2110 PHY use
> genphy_c45_pma_read_abilities() directly, since it doesn't have the
> issue with the wrong abilities being reported.

Series applied, thanks Maxime.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers
@ 2019-02-28  5:42   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2019-02-28  5:42 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: andrew, f.fainelli, antoine.tenart, netdev, gregory.clement,
	linux, linux-kernel, thomas.petazzoni, miquel.raynal,
	linux-arm-kernel, hkallweit1

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Mon, 25 Feb 2019 17:14:05 +0100

> Recent work on C45 helpers by Heiner made the
> genphy_c45_pma_read_abilities function generic enough to use as a
> default .get_featutes implementation.
> 
> This series removes the remaining redundant code in
> mv3310_get_features(), and makes the 2110 PHY use
> genphy_c45_pma_read_abilities() directly, since it doesn't have the
> issue with the wrong abilities being reported.

Series applied, thanks Maxime.

_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2019-02-28  5:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 16:14 [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers Maxime Chevallier
2019-02-25 16:14 ` Maxime Chevallier
2019-02-25 16:14 ` [PATCH net-next 1/2] net: phy: marvell10g: Let genphy_c45_pma_read_abilities set Aneg bit Maxime Chevallier
2019-02-25 16:14   ` Maxime Chevallier
2019-02-25 16:14 ` [PATCH net-next 2/2] net: phy: marvell10g: Use the generic C45 helper to read the 2110 features Maxime Chevallier
2019-02-25 16:14   ` Maxime Chevallier
2019-02-28  5:42 ` [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers David Miller
2019-02-28  5:42   ` David Miller

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.