net: hns3: fix wrong use of semaphore up
authorJie Wang <wangjie125@huawei.com>
Tue, 13 Aug 2024 14:10:20 +0000 (22:10 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 Aug 2024 11:07:08 +0000 (13:07 +0200)
commit8445d9d3c03101859663d34fda747f6a50947556
treec1c50507a6c412730068182e46672cb0da23dcb8
parent7965a7f32a53d9ad807ce2c53bdda69ba104974f
net: hns3: fix wrong use of semaphore up

Currently, if hns3 PF or VF FLR reset failed after five times retry,
the reset done process will directly release the semaphore
which has already released in hclge_reset_prepare_general.
This will cause down operation fail.

So this patch fixes it by adding reset state judgement. The up operation is
only called after successful PF FLR reset.

Fixes: 8627bdedc435 ("net: hns3: refactor the precedure of PF FLR")
Fixes: f28368bb4542 ("net: hns3: refactor the procedure of VF FLR")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c