File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed
drivers/infiniband/hw/hns Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -2971,14 +2971,22 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
2971
2971
{
2972
2972
int ret ;
2973
2973
2974
+ if (hr_dev -> pci_dev -> revision == PCI_REVISION_ID_HIP08 ) {
2975
+ ret = free_mr_init (hr_dev );
2976
+ if (ret ) {
2977
+ dev_err (hr_dev -> dev , "failed to init free mr!\n" );
2978
+ return ret ;
2979
+ }
2980
+ }
2981
+
2974
2982
/* The hns ROCEE requires the extdb info to be cleared before using */
2975
2983
ret = hns_roce_clear_extdb_list_info (hr_dev );
2976
2984
if (ret )
2977
- return ret ;
2985
+ goto err_clear_extdb_failed ;
2978
2986
2979
2987
ret = get_hem_table (hr_dev );
2980
2988
if (ret )
2981
- return ret ;
2989
+ goto err_clear_extdb_failed ;
2982
2990
2983
2991
if (hr_dev -> is_vf )
2984
2992
return 0 ;
@@ -2993,6 +3001,9 @@ static int hns_roce_v2_init(struct hns_roce_dev *hr_dev)
2993
3001
2994
3002
err_llm_init_failed :
2995
3003
put_hem_table (hr_dev );
3004
+ err_clear_extdb_failed :
3005
+ if (hr_dev -> pci_dev -> revision == PCI_REVISION_ID_HIP08 )
3006
+ free_mr_exit (hr_dev );
2996
3007
2997
3008
return ret ;
2998
3009
}
@@ -7027,21 +7038,11 @@ static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle)
7027
7038
goto error_failed_roce_init ;
7028
7039
}
7029
7040
7030
- if (hr_dev -> pci_dev -> revision == PCI_REVISION_ID_HIP08 ) {
7031
- ret = free_mr_init (hr_dev );
7032
- if (ret ) {
7033
- dev_err (hr_dev -> dev , "failed to init free mr!\n" );
7034
- goto error_failed_free_mr_init ;
7035
- }
7036
- }
7037
7041
7038
7042
handle -> priv = hr_dev ;
7039
7043
7040
7044
return 0 ;
7041
7045
7042
- error_failed_free_mr_init :
7043
- hns_roce_exit (hr_dev );
7044
-
7045
7046
error_failed_roce_init :
7046
7047
kfree (hr_dev -> priv );
7047
7048
Original file line number Diff line number Diff line change @@ -965,6 +965,9 @@ static int hns_roce_setup_hca(struct hns_roce_dev *hr_dev)
965
965
966
966
spin_lock_init (& hr_dev -> sm_lock );
967
967
968
+ INIT_LIST_HEAD (& hr_dev -> qp_list );
969
+ spin_lock_init (& hr_dev -> qp_list_lock );
970
+
968
971
if (hr_dev -> caps .flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB ||
969
972
hr_dev -> caps .flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB ) {
970
973
INIT_LIST_HEAD (& hr_dev -> pgdir_list );
@@ -1132,9 +1135,6 @@ int hns_roce_init(struct hns_roce_dev *hr_dev)
1132
1135
}
1133
1136
}
1134
1137
1135
- INIT_LIST_HEAD (& hr_dev -> qp_list );
1136
- spin_lock_init (& hr_dev -> qp_list_lock );
1137
-
1138
1138
ret = hns_roce_register_device (hr_dev );
1139
1139
if (ret )
1140
1140
goto error_failed_register_device ;
You can’t perform that action at this time.
0 commit comments