From: Hao Lan <lanhao@huawei.com>
To: <lanhao@huawei.com>, <lipeng321@huawei.com>,
<shenjian15@huawei.com>, <linyunsheng@huawei.com>,
<liuyonglong@huawei.com>, <chenhao418@huawei.com>,
<wangjie125@huawei.com>, <huangguangbin2@huawei.com>,
<yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>,
<xiaojiantao1@h-partners.com>
Subject: [PATCH net 3/3] net: hns3: fix setting incorrect phy link ksettings for firmware in resetting process
Date: Sat, 12 Nov 2022 16:21:18 +0800 [thread overview]
Message-ID: <20221112082118.57844-4-lanhao@huawei.com> (raw)
In-Reply-To: <20221112082118.57844-1-lanhao@huawei.com>
From: Guangbin Huang <huangguangbin2@huawei.com>
Currently, if driver is in phy-imp(phy controlled by imp firmware) mode, as
driver did not update phy link ksettings after initialization process or
not update advertising when getting phy link ksettings from firmware, it
may set incorrect phy link ksettings for firmware in resetting process.
So fix it.
Fixes: f5f2b3e4dcc0 ("net: hns3: add support for imp-controlled PHYs")
Fixes: c5ef83cbb1e9 ("net: hns3: fix for phy_addr error in hclge_mac_mdio_config")
Fixes: 2312e050f42b ("net: hns3: Fix for deadlock problem occurring when unregistering ae_algo")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
---
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index e34ac9c5900e..4e54f91f7a6c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3443,6 +3443,7 @@ static int hclge_update_tp_port_info(struct hclge_dev *hdev)
hdev->hw.mac.autoneg = cmd.base.autoneg;
hdev->hw.mac.speed = cmd.base.speed;
hdev->hw.mac.duplex = cmd.base.duplex;
+ linkmode_copy(hdev->hw.mac.advertising, cmd.link_modes.advertising);
return 0;
}
@@ -11586,9 +11587,12 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
if (ret)
goto err_msi_irq_uninit;
- if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER &&
- !hnae3_dev_phy_imp_supported(hdev)) {
- ret = hclge_mac_mdio_config(hdev);
+ if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) {
+ if (hnae3_dev_phy_imp_supported(hdev))
+ ret = hclge_update_tp_port_info(hdev);
+ else
+ ret = hclge_mac_mdio_config(hdev);
+
if (ret)
goto err_msi_irq_uninit;
}
--
2.30.0
prev parent reply other threads:[~2022-11-12 8:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-12 8:21 [PATCH net 0/3] net: hns3: This series bugfix for the HNS3 ethernet driver Hao Lan
2022-11-12 8:21 ` [PATCH net 1/3] net: hns3: fix incorrect hw rss hash type of rx packet Hao Lan
2022-11-12 8:21 ` [PATCH net 2/3] net: hns3: fix return value check bug of rx copybreak Hao Lan
2022-11-14 7:39 ` Leon Romanovsky
2022-11-14 8:47 ` Hao Lan
2022-11-12 8:21 ` Hao Lan [this message]
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=20221112082118.57844-4-lanhao@huawei.com \
--to=lanhao@huawei.com \
--cc=chenhao418@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=huangguangbin2@huawei.com \
--cc=kuba@kernel.org \
--cc=linyunsheng@huawei.com \
--cc=lipeng321@huawei.com \
--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=xiaojiantao1@h-partners.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).