net: hns3: fix kernel crash problem in concurrent scenario
authorYonglong Liu <liuyonglong@huawei.com>
Wed, 5 Jun 2024 07:20:57 +0000 (15:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jun 2024 11:20:28 +0000 (12:20 +0100)
commit12cda920212a49fa22d9e8b9492ac4ea013310a4
treee3e46182c019a6cab58b623cc9d8f9fe608ffa7f
parentb472b996a43404a912c5cb4f27050022fdbce10c
net: hns3: fix kernel crash problem in concurrent scenario

When link status change, the nic driver need to notify the roce
driver to handle this event, but at this time, the roce driver
may uninit, then cause kernel crash.

To fix the problem, when link status change, need to check
whether the roce registered, and when uninit, need to wait link
update finish.

Fixes: 45e92b7e4e27 ("net: hns3: add calling roce callback function when link status change")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c