* [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
@ 2019-02-16 19:39 Heiner Kallweit
2019-02-16 19:44 ` [PATCH v2 net-next 1/2] " Heiner Kallweit
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:39 UTC (permalink / raw
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit
may still be set, therefore clear it. This is also in line with what
genphy_setup_forced() does for Clause 22.
v2:
- fix a typo in patch 1
Heiner Kallweit (2):
net: phy: disable aneg in genphy_c45_pma_setup_forced
net: phy: marvell10g: improve mv3310_config_aneg
drivers/net/phy/marvell10g.c | 9 ++-------
drivers/net/phy/phy-c45.c | 4 ++++
2 files changed, 6 insertions(+), 7 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
2019-02-16 19:39 [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
@ 2019-02-16 19:44 ` Heiner Kallweit
2019-02-17 2:37 ` Florian Fainelli
2019-02-16 19:44 ` [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
2019-02-21 4:19 ` [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:44 UTC (permalink / raw
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
still be set, therefore clear it. This is also in line with what
genphy_setup_forced() does for Clause 22.
v2:
- fix typo
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/phy-c45.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index bef126344..98a04d4cd 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -70,7 +70,11 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
if (ret < 0)
return ret;
- return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+ ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+ if (ret < 0)
+ return ret;
+
+ return genphy_c45_an_disable_aneg(phydev);
}
EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg
2019-02-16 19:39 [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
2019-02-16 19:44 ` [PATCH v2 net-next 1/2] " Heiner Kallweit
@ 2019-02-16 19:44 ` Heiner Kallweit
2019-02-17 2:37 ` Florian Fainelli
2019-02-21 4:19 ` [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:44 UTC (permalink / raw
To: Andrew Lunn, Florian Fainelli, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled"
bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed
any longer. And the code pattern is now the same as in
genphy_config_aneg().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/phy/marvell10g.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 496805c0d..4a6ae63ab 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -271,13 +271,8 @@ static int mv3310_config_aneg(struct phy_device *phydev)
/* We don't support manual MDI control */
phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
- if (phydev->autoneg == AUTONEG_DISABLE) {
- ret = genphy_c45_pma_setup_forced(phydev);
- if (ret < 0)
- return ret;
-
- return genphy_c45_an_disable_aneg(phydev);
- }
+ if (phydev->autoneg == AUTONEG_DISABLE)
+ return genphy_c45_pma_setup_forced(phydev);
linkmode_and(phydev->advertising, phydev->advertising,
phydev->supported);
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
2019-02-16 19:44 ` [PATCH v2 net-next 1/2] " Heiner Kallweit
@ 2019-02-17 2:37 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-17 2:37 UTC (permalink / raw
To: Heiner Kallweit, Andrew Lunn, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
On 2/16/2019 11:44 AM, Heiner Kallweit wrote:
> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may
> still be set, therefore clear it. This is also in line with what
> genphy_setup_forced() does for Clause 22.
>
> v2:
> - fix typo
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg
2019-02-16 19:44 ` [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
@ 2019-02-17 2:37 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2019-02-17 2:37 UTC (permalink / raw
To: Heiner Kallweit, Andrew Lunn, David Miller,
Russell King - ARM Linux
Cc: netdev@vger.kernel.org
On 2/16/2019 11:44 AM, Heiner Kallweit wrote:
> Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled"
> bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed
> any longer. And the code pattern is now the same as in
> genphy_config_aneg().
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
2019-02-16 19:39 [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
2019-02-16 19:44 ` [PATCH v2 net-next 1/2] " Heiner Kallweit
2019-02-16 19:44 ` [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
@ 2019-02-21 4:19 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-02-21 4:19 UTC (permalink / raw
To: hkallweit1; +Cc: andrew, f.fainelli, linux, netdev
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sat, 16 Feb 2019 20:39:57 +0100
> When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit
> may still be set, therefore clear it. This is also in line with what
> genphy_setup_forced() does for Clause 22.
>
> v2:
> - fix a typo in patch 1
Applied, thanks Heiner.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-21 4:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-16 19:39 [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
2019-02-16 19:44 ` [PATCH v2 net-next 1/2] " Heiner Kallweit
2019-02-17 2:37 ` Florian Fainelli
2019-02-16 19:44 ` [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
2019-02-17 2:37 ` Florian Fainelli
2019-02-21 4:19 ` [PATCH v2 net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced 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.