linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jijie Shao <shaojijie@huawei.com>
To: <yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>
Cc: <shenjian15@huawei.com>, <wangjie125@huawei.com>,
	<liuyonglong@huawei.com>, <shaojijie@huawei.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH net 7/8] net: hns3: fix port duplex configure error in IMP reset
Date: Thu, 7 Mar 2024 09:01:14 +0800	[thread overview]
Message-ID: <20240307010115.3054770-8-shaojijie@huawei.com> (raw)
In-Reply-To: <20240307010115.3054770-1-shaojijie@huawei.com>

From: Jie Wang <wangjie125@huawei.com>

Currently, the mac port is fixed to configured as full dplex mode in
hclge_mac_init() when driver initialization or reset restore. Users may
change the mode to half duplex with ethtool,  so it may cause the user
configuration dropped after reset.

To fix it, don't change the duplex mode when resetting.

Fixes: 2d03eacc0b7e ("net: hns3: Only update mac configuation when necessary")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 349e4a1946ab..b4afb66efe5c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2903,7 +2903,10 @@ static int hclge_mac_init(struct hclge_dev *hdev)
 	int ret;
 
 	hdev->support_sfp_query = true;
-	hdev->hw.mac.duplex = HCLGE_MAC_FULL;
+
+	if (!test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
+		hdev->hw.mac.duplex = HCLGE_MAC_FULL;
+
 	ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.speed,
 					 hdev->hw.mac.duplex, hdev->hw.mac.lane_num);
 	if (ret)
-- 
2.30.0


  parent reply	other threads:[~2024-03-07  1:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2024-03-07  1:01 ` [PATCH net 1/8] net: hns3: fix wrong judgment condition issue Jijie Shao
2024-03-07  1:01 ` [PATCH net 2/8] net: hns3: add new 200G link modes for hisilicon device Jijie Shao
2024-03-07  1:01 ` [PATCH net 3/8] net: hns3: Disable SerDes serial loopback for HiLink H60 Jijie Shao
2024-03-07  1:01 ` [PATCH net 4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices Jijie Shao
2024-03-07  1:01 ` [PATCH net 5/8] net: hns3: fix delete tc fail issue Jijie Shao
2024-03-07  1:01 ` [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Jijie Shao
2024-03-07 11:24   ` Sunil Kovvuri Goutham
2024-03-08  9:38     ` Jijie Shao
2024-03-07  1:01 ` Jijie Shao [this message]
2024-03-07  1:01 ` [PATCH net 8/8] net: hns3: add checking for vf id of mailbox Jijie Shao
2024-03-07 11:09   ` Sunil Kovvuri Goutham
2024-03-08 12:10 ` [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf

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=20240307010115.3054770-8-shaojijie@huawei.com \
    --to=shaojijie@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=wangjie125@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).