]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/hns: Fix HW configurations not cleared in error flow
authorwenglianfa <wenglianfa@huawei.com>
Thu, 3 Jul 2025 11:39:01 +0000 (19:39 +0800)
committerLeon Romanovsky <leon@kernel.org>
Sun, 6 Jul 2025 06:46:02 +0000 (02:46 -0400)
hns_roce_clear_extdb_list_info() will eventually do some HW
configurations through FW, and they need to be cleared by
calling hns_roce_function_clear() when the initialization
fails.

Fixes: 7e78dd816e45 ("RDMA/hns: Clear extended doorbell info before using")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20250703113905.3597124-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c

index 602c5a4c682a100ed3991b6fe0df409e270a901b..4f2dbc3ffb31f4b9981ae4b5c0e4cb8292e0fede 100644 (file)
@@ -3001,7 +3001,7 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
 
        ret = get_hem_table(hr_dev);
        if (ret)
-               goto err_clear_extdb_failed;
+               goto err_get_hem_table_failed;
 
        if (hr_dev->is_vf)
                return 0;
@@ -3016,6 +3016,8 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
 
 err_llm_init_failed:
        put_hem_table(hr_dev);
+err_get_hem_table_failed:
+       hns_roce_function_clear(hr_dev);
 err_clear_extdb_failed:
        if (hr_dev->pci_dev->revision == PCI_REVISION_ID_HIP08)
                free_mr_exit(hr_dev);