netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lipeng <lipeng321@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <salil.mehta@huawei.com>,
	<lipeng321@huawei.com>
Subject: [PATCH V2 net-next 2/9] net: hns3: Refactor mac_init function
Date: Thu, 2 Nov 2017 20:45:16 +0800	[thread overview]
Message-ID: <1509626723-18619-3-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1509626723-18619-1-git-send-email-lipeng321@huawei.com>

From: qumingguang <qumingguang@huawei.com>

It needs initialize mdio in initialization process, but reset process
does not reset mdio, so do not initialize mdio in reset process.
This patch move out the mdio configuration function from the mac_init.
So mac_init can be used both in reset process and initialization process.

Signed-off-by: qumingguang <qumingguang@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 404757a..5daa8c7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2228,13 +2228,6 @@ static int hclge_mac_init(struct hclge_dev *hdev)
 
 	mac->link = 0;
 
-	ret = hclge_mac_mdio_config(hdev);
-	if (ret) {
-		dev_warn(&hdev->pdev->dev,
-			 "mdio config fail ret=%d\n", ret);
-		return ret;
-	}
-
 	/* Initialize the MTA table work mode */
 	hdev->accept_mta_mc	= true;
 	hdev->enable_mta	= true;
@@ -4498,6 +4491,13 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
 		return ret;
 	}
 
+	ret = hclge_mac_mdio_config(hdev);
+	if (ret) {
+		dev_warn(&hdev->pdev->dev,
+			 "mdio config fail ret=%d\n", ret);
+		return ret;
+	}
+
 	ret = hclge_mac_init(hdev);
 	if (ret) {
 		dev_err(&pdev->dev, "Mac init error, ret = %d\n", ret);
-- 
1.9.1

  parent reply	other threads:[~2017-11-02 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 12:45 [PATCH V2 net-next 0/9] net: hns3: add support for reset Lipeng
2017-11-02 12:29 ` David Miller
2017-11-02 12:45 ` [PATCH V2 net-next 1/9] net: hns3: Refactor the mapping of tqp to vport Lipeng
2017-11-02 12:45 ` Lipeng [this message]
2017-11-02 12:45 ` [PATCH V2 net-next 3/9] net: hns3: Refactor the initialization of command queue Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 4/9] net: hns3: Add support for misc interrupt Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 5/9] net: hns3: Add reset process in hclge_main Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 6/9] net: hns3: Add timeout process in hns3_enet Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 7/9] net: hns3: Add reset interface implementation in client Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 8/9] net: hns3: Fix a misuse to devm_free_irq Lipeng
2017-11-02 12:45 ` [PATCH V2 net-next 9/9] net: hns3: hns3:fix a bug about statistic counter in reset process Lipeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509626723-18619-3-git-send-email-lipeng321@huawei.com \
    --to=lipeng321@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).