]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix a not link up issue when fibre port supports autoneg
authorJian Shen <shenjian15@huawei.com>
Thu, 5 Mar 2020 01:47:53 +0000 (09:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:17:40 +0000 (07:17 +0100)
commit1bb3509a272ddd7a3b53932ac96bb9b658ec94c0
treea7d489bc0abb83aa2efde3f81330e82c07163133
parent3b24474414830e364c5fefa670d457db181f6ff8
net: hns3: fix a not link up issue when fibre port supports autoneg

[ Upstream commit 6368875d7f9d53c362b770ef4a82d5038c6b370e ]

When fibre port supports auto-negotiation, the IMP(Intelligent
Management Process) processes the speed of auto-negotiation
and the  user's speed separately.
For below case, the port will get a not link up problem.
step 1: disables auto-negotiation and sets speed to A, then
the driver's MAC speed will be updated to A.
step 2: enables auto-negotiation and MAC gets negotiated
speed B, then the driver's MAC speed will be updated to B
through querying in periodical task.
step 3: MAC gets new negotiated speed A.
step 4: disables auto-negotiation and sets speed to B before
periodical task query new MAC speed A, the driver will  ignore
the speed configuration.

This patch fixes it by skipping speed and duplex checking when
fibre port supports auto-negotiation.

Fixes: c8c430832346 ("net: hns3: add autoneg and change speed support for fibre port")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c