提交 9a6f8237 编写于 作者: J Jian Shen 提交者: Yang Yingliang

net: hns3: skip mac speed and duplex modification checking for fibre port support autoneg

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

For some boards the fibre port supports autoneg, and the firmware
handles the autoneg speed and user speed separately.

step 1: user disables autoneg, and set the mac speed A, the driver
will update the mac speed to A.
step 2: user enables autoneg, and the negotiated speed is B, the
driver will update the mac speed to B.
step 3: user disable the autoneg, and set the mac speed B, the
driver will discard the set mac speed B command, because the speed
is not changed by step 2. But for firmware, it will change the mac
speed to A by step 1 when received disable autoneg command.
In this case, the port can't link up.

This patch fixes it by skip mac speed and duplex modification
checking for fibre port support autoneg.

Fixes: 22f48e24a23d ("net: hns3: add autoneg and change speed support for fibre port")
Signed-off-by: NJian Shen <shenjian15@huawei.com>
Reviewed-by: NPeng Li <lipeng321@huawei.com>
Reviewed-by: NZhong Zhaohui <zhongzhaohui@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0a616c6a
...@@ -2481,10 +2481,12 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed, ...@@ -2481,10 +2481,12 @@ static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed,
int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex) int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex)
{ {
struct hclge_mac *mac = &hdev->hw.mac;
int ret; int ret;
duplex = hclge_check_speed_dup(duplex, speed); duplex = hclge_check_speed_dup(duplex, speed);
if (hdev->hw.mac.speed == speed && hdev->hw.mac.duplex == duplex) if (!mac->support_autoneg && mac->speed == speed &&
mac->duplex == duplex)
return 0; return 0;
ret = hclge_cfg_mac_speed_dup_hw(hdev, speed, duplex); ret = hclge_cfg_mac_speed_dup_hw(hdev, speed, duplex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册