Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d736fc6c authored by Jian Shen's avatar Jian Shen Committed by David S. Miller
Browse files

net: hns3: restore the MAC autoneg state after reset



When doing global reset, the MAC autoneg state of fibre
port is set to default, which may cause user configuration
lost. This patch fixes it by restore the MAC autoneg state
after reset.

Fixes: 22f48e24 ("net: hns3: add autoneg and change speed support for fibre port")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe4144d4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2400,6 +2400,15 @@ static int hclge_mac_init(struct hclge_dev *hdev)
		return ret;
	}

	if (hdev->hw.mac.support_autoneg) {
		ret = hclge_set_autoneg_en(hdev, hdev->hw.mac.autoneg);
		if (ret) {
			dev_err(&hdev->pdev->dev,
				"Config mac autoneg fail ret=%d\n", ret);
			return ret;
		}
	}

	mac->link = 0;

	if (mac->user_fec_mode & BIT(HNAE3_FEC_USER_DEF)) {