diff mbox series

[net,stable,4.19.y,1/1] net: hns: Fix WARNING when hns modules installed

Message ID 1555951737-5231-1-git-send-email-xiaojun2@hisilicon.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [net,stable,4.19.y,1/1] net: hns: Fix WARNING when hns modules installed | expand

Commit Message

xiaojun2@hisilicon.com April 22, 2019, 4:48 p.m. UTC
From: Jun Xiao <xiaojun2@hisilicon.com>

Commit dfdf26babc98 upstream

this patch need merge to 4.19.y stable kernel

Fix Conflict:already fixed the confilct dfdf26babc98 with Yonglong Liu

stable candidate:user cannot connect to the internet via hns dev
by default setting without this patch

we have already verified this patch on kunpeng916 platform,
and it works well.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jun Xiao <xiaojun2@hisilicon.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Graeme Gregory April 25, 2019, 7:17 a.m. UTC | #1
On Tue, Apr 23, 2019 at 12:48:57AM +0800, xiaojun2@hisilicon.com wrote:
> From: Jun Xiao <xiaojun2@hisilicon.com>
> 
> Commit dfdf26babc98 upstream
> 
> this patch need merge to 4.19.y stable kernel
> 
> Fix Conflict:already fixed the confilct dfdf26babc98 with Yonglong Liu
> 
> stable candidate:user cannot connect to the internet via hns dev
> by default setting without this patch
> 
> we have already verified this patch on kunpeng916 platform,
> and it works well.
> 
> Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
> Signed-off-by: Jun Xiao <xiaojun2@hisilicon.com>

You might want to make it clear in the description that without this patch the
D05/Kunpeng916 machine oopses about 50% of the time on boot.

The rest of the time the networking on the machine is totally non functional.

Graeme

> ---
>  drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> index 6242249..283291b 100644
> --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> @@ -1169,6 +1169,12 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
>  	if (!h->phy_dev)
>  		return 0;
>  
> +	phy_dev->supported &= h->if_support;
> +	phy_dev->advertising = phy_dev->supported;
> +
> +	if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
> +		phy_dev->autoneg = false;
> +
>  	if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
>  		phy_dev->dev_flags = 0;
>  
> @@ -1180,15 +1186,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
>  	if (unlikely(ret))
>  		return -ENODEV;
>  
> -	phy_dev->supported &= h->if_support;
> -	phy_dev->advertising = phy_dev->supported;
> -
> -	if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
> -		phy_dev->autoneg = false;
> -
> -	if (h->phy_if == PHY_INTERFACE_MODE_SGMII)
> -		phy_stop(phy_dev);
> -
>  	return 0;
>  }
>  
> -- 
> 1.8.3.1
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 6242249..283291b 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -1169,6 +1169,12 @@  int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
 	if (!h->phy_dev)
 		return 0;
 
+	phy_dev->supported &= h->if_support;
+	phy_dev->advertising = phy_dev->supported;
+
+	if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
+		phy_dev->autoneg = false;
+
 	if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
 		phy_dev->dev_flags = 0;
 
@@ -1180,15 +1186,6 @@  int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h)
 	if (unlikely(ret))
 		return -ENODEV;
 
-	phy_dev->supported &= h->if_support;
-	phy_dev->advertising = phy_dev->supported;
-
-	if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
-		phy_dev->autoneg = false;
-
-	if (h->phy_if == PHY_INTERFACE_MODE_SGMII)
-		phy_stop(phy_dev);
-
 	return 0;
 }