netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Li <lipeng321@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,
	<salil.mehta@huawei.com>, <lipeng321@huawei.com>
Subject: [PATCH net-next 09/12] net: hns3: synchronize speed and duplex from phy when phy link up
Date: Tue, 18 Dec 2018 19:37:56 +0800	[thread overview]
Message-ID: <1545133079-79605-10-git-send-email-lipeng321@huawei.com> (raw)
In-Reply-To: <1545133079-79605-1-git-send-email-lipeng321@huawei.com>

Driver calls phy_connect_direct and registers hclge_mac_adjust_link
to synchronize mac speed and duplex from phy. It is better to
synchronize mac speed and duplex from phy when phy link up.

Signed-off-by: Peng Li <lipeng321@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index d8ef436..dabb843 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -179,6 +179,10 @@ static void hclge_mac_adjust_link(struct net_device *netdev)
 	int duplex, speed;
 	int ret;
 
+	/* When phy link down, do nothing */
+	if (netdev->phydev->link == 0)
+		return;
+
 	speed = netdev->phydev->speed;
 	duplex = netdev->phydev->duplex;
 
-- 
1.9.1

  parent reply	other threads:[~2018-12-18 11:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 11:37 [PATCH net-next 00/12] net: hns3: code optimizations & bugfixes for HNS3 driver Peng Li
2018-12-18 11:37 ` [PATCH net-next 01/12] net: hns3: fix error handling int the hns3_get_vector_ring_chain Peng Li
2018-12-18 11:37 ` [PATCH net-next 02/12] net: hns3: uninitialize pci in the hclgevf_uninit Peng Li
2018-12-18 11:37 ` [PATCH net-next 03/12] net: hns3: fix napi_disable not return problem Peng Li
2018-12-18 11:37 ` [PATCH net-next 04/12] net: hns3: update some variables while hclge_reset()/hclgevf_reset() done Peng Li
2018-12-18 11:37 ` [PATCH net-next 05/12] net: hns3: remove unnecessary configuration recapture while resetting Peng Li
2018-12-18 11:37 ` [PATCH net-next 06/12] net: hns3: fix incomplete uninitialization of IRQ in the hns3_nic_uninit_vector_data() Peng Li
2018-12-18 11:37 ` [PATCH net-next 07/12] net: hns3: update coalesce param per second Peng Li
2018-12-18 11:37 ` [PATCH net-next 08/12] net: hns3: remove 1000M/half support of phy Peng Li
2018-12-18 11:37 ` Peng Li [this message]
2018-12-18 11:37 ` [PATCH net-next 10/12] net: hns3: getting tx and dv buffer size through firmware Peng Li
2018-12-18 11:37 ` [PATCH net-next 11/12] net: hns3: aligning buffer size in SSU to 256 bytes Peng Li
2018-12-18 11:37 ` [PATCH net-next 12/12] net: hns3: fix a SSU buffer checking bug Peng Li
2018-12-18 20:01 ` [PATCH net-next 00/12] net: hns3: code optimizations & bugfixes for HNS3 driver David Miller

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=1545133079-79605-10-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 \
    --cc=yisen.zhuang@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).