netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
@ 2019-02-16 19:08 Heiner Kallweit
  2019-02-16 19:10 ` [PATCH net-next 1/2] " Heiner Kallweit
  2019-02-16 19:11 ` [PATCH net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
  0 siblings, 2 replies; 7+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:08 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.

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

* [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
  2019-02-16 19:08 [PATCH net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
@ 2019-02-16 19:10 ` Heiner Kallweit
  2019-02-16 19:31   ` Stefano Brivio
  2019-02-16 22:43   ` Russell King - ARM Linux admin
  2019-02-16 19:11 ` [PATCH net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit
  1 sibling, 2 replies; 7+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:10 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.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-c45.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index bef126344..0374c50b1 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
 		return ret;
 
 	return 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] 7+ messages in thread

* [PATCH net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg
  2019-02-16 19:08 [PATCH net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
  2019-02-16 19:10 ` [PATCH net-next 1/2] " Heiner Kallweit
@ 2019-02-16 19:11 ` Heiner Kallweit
  1 sibling, 0 replies; 7+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:11 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] 7+ messages in thread

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
  2019-02-16 19:10 ` [PATCH net-next 1/2] " Heiner Kallweit
@ 2019-02-16 19:31   ` Stefano Brivio
  2019-02-16 19:39     ` Heiner Kallweit
  2019-02-16 22:43   ` Russell King - ARM Linux admin
  1 sibling, 1 reply; 7+ messages in thread
From: Stefano Brivio @ 2019-02-16 19:31 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux, netdev@vger.kernel.org

Hi,

On Sat, 16 Feb 2019 20:10:24 +0100
Heiner Kallweit <hkallweit1@gmail.com> 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.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/phy/phy-c45.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index bef126344..0374c50b1 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>  		return ret;
>  
>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
> +	if (ret < 0)

Perhaps you meant ret = phy_write_mmd(...)?

> +		return ret;
> +
> +	return genphy_c45_an_disable_aneg(phydev);
>  }
>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>  

-- 
Stefano

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

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
  2019-02-16 19:31   ` Stefano Brivio
@ 2019-02-16 19:39     ` Heiner Kallweit
  0 siblings, 0 replies; 7+ messages in thread
From: Heiner Kallweit @ 2019-02-16 19:39 UTC (permalink / raw)
  To: Stefano Brivio
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	Russell King - ARM Linux, netdev@vger.kernel.org

On 16.02.2019 20:31, Stefano Brivio wrote:
> Hi,
> 
> On Sat, 16 Feb 2019 20:10:24 +0100
> Heiner Kallweit <hkallweit1@gmail.com> 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.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/net/phy/phy-c45.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
>> index bef126344..0374c50b1 100644
>> --- a/drivers/net/phy/phy-c45.c
>> +++ b/drivers/net/phy/phy-c45.c
>> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>>  		return ret;
>>  
>>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
>> +	if (ret < 0)
> 
> Perhaps you meant ret = phy_write_mmd(...)?
> 
Ups, for sure I meant this. Strange that the compiler doesn't complain.

>> +		return ret;
>> +
>> +	return genphy_c45_an_disable_aneg(phydev);
>>  }
>>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>>  
> 
Heiner


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

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
  2019-02-16 19:10 ` [PATCH net-next 1/2] " Heiner Kallweit
  2019-02-16 19:31   ` Stefano Brivio
@ 2019-02-16 22:43   ` Russell King - ARM Linux admin
  2019-02-16 22:45     ` Heiner Kallweit
  1 sibling, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux admin @ 2019-02-16 22:43 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	netdev@vger.kernel.org

On Sat, Feb 16, 2019 at 08:10:24PM +0100, 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.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/phy/phy-c45.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
> index bef126344..0374c50b1 100644
> --- a/drivers/net/phy/phy-c45.c
> +++ b/drivers/net/phy/phy-c45.c
> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>  		return ret;
>  
>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
> +	if (ret < 0)

This patch does not make sense.

> +		return ret;
> +
> +	return genphy_c45_an_disable_aneg(phydev);
>  }
>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>  
> -- 
> 2.20.1
> 
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

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

* Re: [PATCH net-next 1/2] net: phy: disable aneg in genphy_c45_pma_setup_forced
  2019-02-16 22:43   ` Russell King - ARM Linux admin
@ 2019-02-16 22:45     ` Heiner Kallweit
  0 siblings, 0 replies; 7+ messages in thread
From: Heiner Kallweit @ 2019-02-16 22:45 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Andrew Lunn, Florian Fainelli, David Miller,
	netdev@vger.kernel.org

On 16.02.2019 23:43, Russell King - ARM Linux admin wrote:
> On Sat, Feb 16, 2019 at 08:10:24PM +0100, 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.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/net/phy/phy-c45.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
>> index bef126344..0374c50b1 100644
>> --- a/drivers/net/phy/phy-c45.c
>> +++ b/drivers/net/phy/phy-c45.c
>> @@ -71,6 +71,10 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
>>  		return ret;
>>  
>>  	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
>> +	if (ret < 0)
> 
> This patch does not make sense.
> 
Right, was a typo. Interestingly the compiler didn't complain.
I sent a v2 already.

>> +		return ret;
>> +
>> +	return genphy_c45_an_disable_aneg(phydev);
>>  }
>>  EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
>>  
>> -- 
>> 2.20.1
>>
>>
>>
> 


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

end of thread, other threads:[~2019-02-16 22:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-16 19:08 [PATCH net-next 0/2] net: phy: disable aneg in genphy_c45_pma_setup_forced Heiner Kallweit
2019-02-16 19:10 ` [PATCH net-next 1/2] " Heiner Kallweit
2019-02-16 19:31   ` Stefano Brivio
2019-02-16 19:39     ` Heiner Kallweit
2019-02-16 22:43   ` Russell King - ARM Linux admin
2019-02-16 22:45     ` Heiner Kallweit
2019-02-16 19:11 ` [PATCH net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).