From patchwork Mon Apr 22 16:48:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Jun X-Patchwork-Id: 162623 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3201517jan; Mon, 22 Apr 2019 17:49:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZBkPgtZweEn1NG892wx2g1rEvkpAxO89ZZ2rHdSMVlq4wBsECN4gfRjvJjen4MZoFmtaf X-Received: by 2002:aa7:8190:: with SMTP id g16mr23785660pfi.92.1555980569143; Mon, 22 Apr 2019 17:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555980569; cv=none; d=google.com; s=arc-20160816; b=JThMsR1gtHfdZ9sc69xlztKpDcR5MJEcxxaDngQ/QUOZ6G6eIBi2g3gxmbkVu4XAns HZQsXp+WAB1Y0OiI+zw7pOOD1eJrwW1XqpdAJNVR05fN+3b7Mn5Yz2zyHy3rNSfh57Vf tdBJhj+N4bLLtSiSRKBwf4RU6cNE5Lqp+GTB+SNP5DP6dHTUnFvegj4wJ00//9LDGVWZ q2HAdAmGCfEEgN//j1CBBSc9hngqTJYG53f7ZCs20qB+pAvU0WJsW72I9sIlMmkDLCqY qLchMs9TP+tmtDnZ/JyL8cpNAAlIzvFUUO5AjMn0JDmQ06DBeeDHWtGbzN3SxEiD33Oy EEQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=As7rwc8qpGsrFEw9/GJL1YE5ymbgmeN4yewcnkzvgRM=; b=M3JKc+SeXjZPACz7W4AFpZjZYOVhC5my7i/fM+N+4bqTAEagEA/MLnKmaqe4ku9hgq +RmlfqfuUnDqgG/8Y/ACoJ1wR1yYyPDMaAalm7/DTO1bmT6wBWpveeFPa11yM+2npqfG L429x1dM1Gata1oc62absWsbBbjvWgoyNNw6ehbZyxB3wsGw5Z6SOOOhfC21D36Wqfm4 TPWACTRZRHqP3LiNN0Oo6LpeXAOj395YMt5rWzYZoQZ2Yp9rvI00Jinyz7Zmd41IB4UT PyK84di6pBx3jIWE3RUjIyXYCiSLpGVTE6EZjXYF3S47npYTuByLDQhjX0J0IgjC5+JZ nKuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si13855028pgk.76.2019.04.22.17.49.28; Mon, 22 Apr 2019 17:49:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbfDWAtQ (ORCPT + 9 others); Mon, 22 Apr 2019 20:49:16 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42956 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726421AbfDWAtQ (ORCPT ); Mon, 22 Apr 2019 20:49:16 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D2C223CD63E18D1969F6; Tue, 23 Apr 2019 08:49:12 +0800 (CST) Received: from localhost.localdomain.localdomain (10.90.31.46) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 08:49:04 +0800 From: To: CC: , , , , , Subject: [PATCH] [PATCH net, stable 4.19.y, 1/1] net: hns: Fix WARNING when hns modules installed Date: Tue, 23 Apr 2019 00:48:57 +0800 Message-ID: <1555951737-5231-1-git-send-email-xiaojun2@hisilicon.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.90.31.46] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jun Xiao 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 Signed-off-by: Jun Xiao --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 1.8.3.1 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; }