Skip to content

Commit 7cea834

Browse files
Huazhong Tandavem330
authored andcommitted
net: hns3: ignore new coming low-level reset while doing high-level reset
When processing a higher level reset, the pending lower level reset does not have to be processed anymore, because the higher level reset is the superset of the lower level reset. Therefore, when processing an higher level reset, the request of lower level reset needs to be cleared. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 257e4f2 commit 7cea834

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,20 +2414,25 @@ static enum hnae3_reset_type hclge_get_reset_level(struct hclge_dev *hdev,
24142414
enum hnae3_reset_type rst_level = HNAE3_NONE_RESET;
24152415

24162416
/* return the highest priority reset level amongst all */
2417-
if (test_bit(HNAE3_GLOBAL_RESET, addr))
2417+
if (test_bit(HNAE3_IMP_RESET, addr)) {
2418+
rst_level = HNAE3_IMP_RESET;
2419+
clear_bit(HNAE3_IMP_RESET, addr);
2420+
clear_bit(HNAE3_GLOBAL_RESET, addr);
2421+
clear_bit(HNAE3_CORE_RESET, addr);
2422+
clear_bit(HNAE3_FUNC_RESET, addr);
2423+
} else if (test_bit(HNAE3_GLOBAL_RESET, addr)) {
24182424
rst_level = HNAE3_GLOBAL_RESET;
2419-
else if (test_bit(HNAE3_CORE_RESET, addr))
2425+
clear_bit(HNAE3_GLOBAL_RESET, addr);
2426+
clear_bit(HNAE3_CORE_RESET, addr);
2427+
clear_bit(HNAE3_FUNC_RESET, addr);
2428+
} else if (test_bit(HNAE3_CORE_RESET, addr)) {
24202429
rst_level = HNAE3_CORE_RESET;
2421-
else if (test_bit(HNAE3_IMP_RESET, addr))
2422-
rst_level = HNAE3_IMP_RESET;
2423-
else if (test_bit(HNAE3_FUNC_RESET, addr))
2430+
clear_bit(HNAE3_CORE_RESET, addr);
2431+
clear_bit(HNAE3_FUNC_RESET, addr);
2432+
} else if (test_bit(HNAE3_FUNC_RESET, addr)) {
24242433
rst_level = HNAE3_FUNC_RESET;
2425-
2426-
/* now, clear all other resets */
2427-
clear_bit(HNAE3_GLOBAL_RESET, addr);
2428-
clear_bit(HNAE3_CORE_RESET, addr);
2429-
clear_bit(HNAE3_IMP_RESET, addr);
2430-
clear_bit(HNAE3_FUNC_RESET, addr);
2434+
clear_bit(HNAE3_FUNC_RESET, addr);
2435+
}
24312436

24322437
return rst_level;
24332438
}

0 commit comments

Comments
 (0)