diff mbox series

net: thunderx: start phy before starting autonegotiation

Message ID 20191204152651.13418-1-ykaukab@suse.de (mailing list archive)
State New, archived
Headers show
Series net: thunderx: start phy before starting autonegotiation | expand

Commit Message

Mian Yousaf Kaukab Dec. 4, 2019, 3:26 p.m. UTC
Since "2b3e88ea6528 net: phy: improve phy state checking"
phy_start_aneg() expects phy state to be >= PHY_UP. Call phy_start()
before calling phy_start_aneg() during probe so that autonegotiation
is initiated.

Network fails without this patch on Octeon TX.

Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Lunn Dec. 4, 2019, 3:42 p.m. UTC | #1
On Wed, Dec 04, 2019 at 04:26:51PM +0100, Mian Yousaf Kaukab wrote:
> Since "2b3e88ea6528 net: phy: improve phy state checking"
> phy_start_aneg() expects phy state to be >= PHY_UP. Call phy_start()
> before calling phy_start_aneg() during probe so that autonegotiation
> is initiated.
> 
> Network fails without this patch on Octeon TX.
> 
> Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
> ---
>  drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> index 1e09fdb63c4f..504644257aff 100644
> --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
> @@ -1115,6 +1115,7 @@ static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
>  				       phy_interface_mode(lmac->lmac_type)))
>  			return -ENODEV;
>  
> +		phy_start(lmac->phydev);
>  		phy_start_aneg(lmac->phydev);
>  		return 0;

phy_start() will start aneg, if aneg is configured. So you should be
able to remove the call to phy_start_aneg().

     Andrew
Sergei Shtylyov Dec. 4, 2019, 3:43 p.m. UTC | #2
On 12/04/2019 06:26 PM, Mian Yousaf Kaukab wrote:

> Since "2b3e88ea6528 net: phy: improve phy state checking"

   Since 2b3e88ea6528 ("net: phy: improve phy state checking")

> phy_start_aneg() expects phy state to be >= PHY_UP. Call phy_start()
> before calling phy_start_aneg() during probe so that autonegotiation
> is initiated.
> 
> Network fails without this patch on Octeon TX.
> 
> Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
[...]

MBR, Sergei
David Miller Dec. 4, 2019, 8:30 p.m. UTC | #3
From: Mian Yousaf Kaukab <ykaukab@suse.de>
Date: Wed,  4 Dec 2019 16:26:51 +0100

> Since "2b3e88ea6528 net: phy: improve phy state checking"

As Sergei said, please format this properly and make it the
Fixes: tag.

Thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 1e09fdb63c4f..504644257aff 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1115,6 +1115,7 @@  static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
 				       phy_interface_mode(lmac->lmac_type)))
 			return -ENODEV;
 
+		phy_start(lmac->phydev);
 		phy_start_aneg(lmac->phydev);
 		return 0;
 	}